September 2019
Beginner
512 pages
12h 52m
English
As we have seen before, the GoogleMap widget exposes the markers property, which expects a Set collection of Marker instances to be passed to it. Let's see how to add markers by setting the markers property:
class MapPage extends StatelessWidget { final _markers = { Marker( position: LatLng(51.178883, -1.826215), markerId: MarkerId('1'), infoWindow: InfoWindow(title: 'Stonehenge'), icon: BitmapDescriptor.defaultMarker ), Marker( position: LatLng(41.890209, 12.492231), markerId: MarkerId('2'), infoWindow: InfoWindow(title: 'Colosseum'), icon: BitmapDescriptor.defaultMarker ), Marker( position: LatLng(36.106964, ...Read now
Unlock full access