'error: The element type 'Set<Marker>' can't be assigned to the set type 'Marker'

I am trying to place a marker for two purposes:
- Live geolocation tracking.
- Showing multiple markers stored in the firebase database.
so inside google map widget I tried:
markers:{
Set<Marker>.of(((marker != null) ? [marker] : [])), //This one for live geotracking
Set<Marker>.of(markers.values), // markers stored in database
},
How can I fix this?
Solution 1:[1]
I think the problem is in your check "marker != null" Since marker is a set, you should check instead for "marker !={}"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Alfredowitch |
