AMapWidget constructor

const AMapWidget(
  1. {Key key,
  2. AMapApiKey apiKey,
  3. CameraPosition initialCameraPosition: const CameraPosition(target: LatLng(39.909187, 116.397451), zoom: 10),
  4. MapType mapType: MapType.normal,
  5. bool buildingsEnabled: true,
  6. bool compassEnabled: false,
  7. bool labelsEnabled: true,
  8. LatLngBounds limitBounds,
  9. MinMaxZoomPreference minMaxZoomPreference,
  10. bool rotateGesturesEnabled: true,
  11. bool scaleEnabled: true,
  12. bool scrollGesturesEnabled: true,
  13. bool tiltGesturesEnabled: true,
  14. bool touchPoiEnabled: true,
  15. bool trafficEnabled: false,
  16. bool zoomGesturesEnabled: true,
  17. MapCreatedCallback onMapCreated,
  18. Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers,
  19. CustomStyleOptions customStyleOptions,
  20. MyLocationStyleOptions myLocationStyleOptions,
  21. ArgumentCallback<CameraPosition> onCameraMove,
  22. ArgumentCallback<CameraPosition> onCameraMoveEnd,
  23. ArgumentCallback<AMapLocation> onLocationChanged,
  24. ArgumentCallback<LatLng> onTap,
  25. ArgumentCallback<LatLng> onLongPress,
  26. ArgumentCallback<AMapPoi> onPoiTouched,
  27. Set<Marker> markers,
  28. Set<Polyline> polylines,
  29. Set<Polygon> polygons}
)

创建一个展示高德地图的widget AssertionError will be thrown if initialCameraPosition is null;

Implementation

const AMapWidget({
  Key key,
  this.apiKey,
  this.initialCameraPosition =
      const CameraPosition(target: LatLng(39.909187, 116.397451), zoom: 10),
  this.mapType = MapType.normal,
  this.buildingsEnabled = true,
  this.compassEnabled = false,
  this.labelsEnabled = true,
  this.limitBounds,
  this.minMaxZoomPreference,
  this.rotateGesturesEnabled = true,
  this.scaleEnabled = true,
  this.scrollGesturesEnabled = true,
  this.tiltGesturesEnabled = true,
  this.touchPoiEnabled = true,
  this.trafficEnabled = false,
  this.zoomGesturesEnabled = true,
  this.onMapCreated,
  this.gestureRecognizers,
  this.customStyleOptions,
  this.myLocationStyleOptions,
  this.onCameraMove,
  this.onCameraMoveEnd,
  this.onLocationChanged,
  this.onTap,
  this.onLongPress,
  this.onPoiTouched,
  this.markers,
  this.polylines,
  this.polygons,
})  : assert(initialCameraPosition != null),
      super(key: key);