AMapView constructor Null safety

const AMapView(
  1. {Key? key,
  2. AMapViewController? controller,
  3. bool autoLocateAfterInit = false,
  4. MapType mapType = MapType.NORMAL,
  5. MapLanguage mapLanguage = MapLanguage.CHINESE,
  6. LocationType locationType = LocationType.LOCATE,
  7. int locationInterval = 2000,
  8. bool showTraffic = false,
  9. bool showBuildings = true,
  10. bool showMapText = true,
  11. bool showZoomControl = true,
  12. bool showCompass = false,
  13. bool showLocationButton = false,
  14. bool showScaleControl = false,
  15. bool showIndoorMap = false,
  16. bool showIndoorMapControl = false,
  17. bool? allGestureEnable,
  18. bool zoomGestureEnable = true,
  19. bool rotateGestureEnable = true,
  20. bool scrollGestureEnable = true,
  21. bool tiltGestureEnable = true,
  22. bool isGestureScaleByMapCenter = false,
  23. ZoomPosition zoomPosition = ZoomPosition.RIGHT_BOTTOM,
  24. LogoPosition logoPosition = LogoPosition.BOTTOM_LEFT,
  25. LogoMargin? logoMargin,
  26. CompassMargin? compassMargin,
  27. ScaleMargin? scaleMargin,
  28. double initialZoomLevel = 12.0,
  29. double maxZoomLevel = 20.0,
  30. double minZoomLevel = 3.0,
  31. String? customMapStyleId,
  32. CameraPosition? defaultCameraPosition,
  33. List<LatLng>? androidBound,
  34. IosBound? iOSBound}
)

Implementation

const AMapView({
  Key? key,
  this.controller,
  this.autoLocateAfterInit = false,
  this.mapType = MapType.NORMAL,
  this.mapLanguage = MapLanguage.CHINESE,
  this.locationType = LocationType.LOCATE,
  this.locationInterval = 2000,
  this.showTraffic = false,
  this.showBuildings = true,
  this.showMapText = true,
  this.showZoomControl = true,
  this.showCompass = false,
  this.showLocationButton = false,
  this.showScaleControl = false,
  this.showIndoorMap = false,
  this.showIndoorMapControl = false,
  this.allGestureEnable,
  this.zoomGestureEnable = true,
  this.rotateGestureEnable = true,
  this.scrollGestureEnable = true,
  this.tiltGestureEnable = true,
  this.isGestureScaleByMapCenter = false,
  this.zoomPosition = ZoomPosition.RIGHT_BOTTOM,
  this.logoPosition = LogoPosition.BOTTOM_LEFT,
  this.logoMargin,
  this.compassMargin,
  this.scaleMargin,
  this.initialZoomLevel = 12.0,
  this.maxZoomLevel = 20.0,
  this.minZoomLevel = 3.0,
  this.customMapStyleId,
  this.defaultCameraPosition,
  this.androidBound,
  this.iOSBound,
})  : assert(
          initialZoomLevel >= minZoomLevel &&
              initialZoomLevel <= maxZoomLevel,
          '初始化缩放等级不能小于最小缩放等级,并且不能大于最大缩放等级'),
      assert(maxZoomLevel <= 20, '最大缩放等级不能大于20'),
      assert(minZoomLevel >= 3, '最小缩放等级不能小于3'),
      super(key: key);