AMapView constructor Null safety

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

Implementation

const AMapView({
  Key? key,
  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,
})  : assert(
          initialZoomLevel >= minZoomLevel &&
              initialZoomLevel <= maxZoomLevel,
          '初始化缩放等级不能小于最小缩放等级,并且不能大于最大缩放等级'),
      assert(maxZoomLevel <= 20, '最大缩放等级不能大于20'),
      assert(minZoomLevel >= 3, '最小缩放等级不能小于3'),
      super(key: key);