GoogleMap constructor

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

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.style,
  this.onMapCreated,
  this.gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{},
  this.webGestureHandling,
  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.fortyFiveDegreeImageryEnabled = false,
  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,
  this.cloudMapId,
});