GoogleMap(
mapType: MapType.normal,
initialCameraPosition: CameraPosition(
target: geocode!,
zoom: 14,
),
onMapCreated: (GoogleMapController controller) async {
googleMapControllerCompleter.complete(controller);
},
compassEnabled: true,
myLocationEnabled: true,
onTap: (v) {},
markers: <--->),
------
List<Marker> dumA = [];
markerGroupA = Set<Marker>.of(dumA);
List<Marker> dumB = [];
markerGroupB = Set<Marker>.of(dumB);
I have a list of these two marker groups. How can I display them on markers:
? I don’t want to put them into one Set<Marker>
if possible. I was able to do that but I lost the code and can’t find a way to do it.
2
Answers
A
Set<T>
has a methodunion
that merges 2 Sets.You can find the dart documentation here : https://api.flutter.dev/flutter/dart-core/Set/union.html
Use addAll function as below