GoogleMap constructor

const GoogleMap({
  1. Key? key,
  2. required CameraPosition initialCameraPosition,
  3. MapCreatedCallback? onMapCreated,
  4. Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{},
  5. bool compassEnabled = true,
  6. bool mapToolbarEnabled = true,
  7. CameraTargetBounds cameraTargetBounds = CameraTargetBounds.unbounded,
  8. MapType mapType = MapType.normal,
  9. MinMaxZoomPreference minMaxZoomPreference = MinMaxZoomPreference.unbounded,
  10. bool rotateGesturesEnabled = true,
  11. bool scrollGesturesEnabled = true,
  12. bool zoomControlsEnabled = true,
  13. bool zoomGesturesEnabled = true,
  14. bool liteModeEnabled = false,
  15. bool tiltGesturesEnabled = true,
  16. bool myLocationEnabled = false,
  17. bool myLocationButtonEnabled = true,
  18. TextDirection? layoutDirection,
  19. EdgeInsets padding = EdgeInsets.zero,
  20. bool indoorViewEnabled = false,
  21. bool trafficEnabled = false,
  22. bool buildingsEnabled = true,
  23. Set<Marker> markers = const <Marker>{},
  24. Set<Polygon> polygons = const <Polygon>{},
  25. Set<Polyline> polylines = const <Polyline>{},
  26. Set<Circle> circles = const <Circle>{},
  27. VoidCallback? onCameraMoveStarted,
  28. Set<TileOverlay> tileOverlays = const <TileOverlay>{},
  29. CameraPositionCallback? onCameraMove,
  30. VoidCallback? onCameraIdle,
  31. ArgumentCallback<LatLng>? onTap,
  32. ArgumentCallback<LatLng>? onLongPress,
})

Creates a widget displaying data from Google Maps services.

AssertionError will be thrown if initialCameraPosition is null;

Implementation

const GoogleMap({
  super.key,
  required this.initialCameraPosition,
  this.onMapCreated,
  this.gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{},
  this.compassEnabled = true,
  this.mapToolbarEnabled = true,
  this.cameraTargetBounds = CameraTargetBounds.unbounded,
  this.mapType = MapType.normal,
  this.minMaxZoomPreference = MinMaxZoomPreference.unbounded,
  this.rotateGesturesEnabled = true,
  this.scrollGesturesEnabled = true,
  this.zoomControlsEnabled = true,
  this.zoomGesturesEnabled = true,
  this.liteModeEnabled = false,
  this.tiltGesturesEnabled = true,
  this.myLocationEnabled = false,
  this.myLocationButtonEnabled = true,
  this.layoutDirection,

  /// If no padding is specified default padding will be 0.
  this.padding = EdgeInsets.zero,
  this.indoorViewEnabled = false,
  this.trafficEnabled = false,
  this.buildingsEnabled = true,
  this.markers = const <Marker>{},
  this.polygons = const <Polygon>{},
  this.polylines = const <Polyline>{},
  this.circles = const <Circle>{},
  this.onCameraMoveStarted,
  this.tileOverlays = const <TileOverlay>{},
  this.onCameraMove,
  this.onCameraIdle,
  this.onTap,
  this.onLongPress,
});