diff --git a/CHANGELOG.md b/CHANGELOG.md index f70388f70..cad7ca606 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## UNRELEASED + +### Breaking changes + +* All Dart enums have been migrated from mixed cases to lower camelcase according to the `camel_case_types` lint rule. + ## 0.19.0 This is the first version where all packages are published on pub.dev. Please diff --git a/analysis_options.yaml b/analysis_options.yaml index e75e33253..3f7cb2127 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -7,5 +7,4 @@ analyzer: linter: rules: - camel_case_types: false constant_identifier_names: false \ No newline at end of file diff --git a/example/lib/attribution.dart b/example/lib/attribution.dart index 45c644424..8b17a869a 100644 --- a/example/lib/attribution.dart +++ b/example/lib/attribution.dart @@ -33,10 +33,10 @@ class _AttributionBodyState extends State { children: [ buildDefaultPositionButton(), buildPositionButton(null), - buildPositionButton(AttributionButtonPosition.TopRight), - buildPositionButton(AttributionButtonPosition.TopLeft), - buildPositionButton(AttributionButtonPosition.BottomRight), - buildPositionButton(AttributionButtonPosition.BottomLeft), + buildPositionButton(AttributionButtonPosition.topRight), + buildPositionButton(AttributionButtonPosition.topLeft), + buildPositionButton(AttributionButtonPosition.bottomRight), + buildPositionButton(AttributionButtonPosition.bottomLeft), ], ), Expanded( diff --git a/example/lib/map_ui.dart b/example/lib/map_ui.dart index 7341e418f..3d8686543 100644 --- a/example/lib/map_ui.dart +++ b/example/lib/map_ui.dart @@ -66,7 +66,7 @@ class MapUiBodyState extends State { bool _myLocationEnabled = true; bool _telemetryEnabled = true; bool _countriesVisible = true; - MyLocationTrackingMode _myLocationTrackingMode = MyLocationTrackingMode.None; + MyLocationTrackingMode _myLocationTrackingMode = MyLocationTrackingMode.none; List? _featureQueryFilter; Fill? _selectedFill; @@ -361,7 +361,7 @@ class MapUiBodyState extends State { doubleClickZoomEnabled: _doubleClickToZoomEnabled, myLocationEnabled: _myLocationEnabled, myLocationTrackingMode: _myLocationTrackingMode, - myLocationRenderMode: MyLocationRenderMode.GPS, + myLocationRenderMode: MyLocationRenderMode.gps, onMapClick: (point, latLng) async { debugPrint( "Map click: ${point.x},${point.y} ${latLng.latitude}/${latLng.longitude}"); @@ -402,7 +402,7 @@ class MapUiBodyState extends State { }, onCameraTrackingDismissed: () { setState(() { - _myLocationTrackingMode = MyLocationTrackingMode.None; + _myLocationTrackingMode = MyLocationTrackingMode.none; }); }, onUserLocationUpdated: (location) { diff --git a/example/lib/sources.dart b/example/lib/sources.dart index 8c7faa534..10aa3b2f7 100644 --- a/example/lib/sources.dart +++ b/example/lib/sources.dart @@ -254,7 +254,7 @@ class FullMapState extends State { final _stylesAndLoaders = [ const StyleInfo( name: "Vector", - baseStyle: MaplibreStyles.DEMO, + baseStyle: MaplibreStyles.demo, addDetails: addVector, position: CameraPosition(target: LatLng(33.3832, -118.4333), zoom: 6), ), @@ -270,7 +270,7 @@ class FullMapState extends State { ), const StyleInfo( name: "Geojson cluster", - baseStyle: MaplibreStyles.DEMO, + baseStyle: MaplibreStyles.demo, addDetails: addGeojsonCluster, position: CameraPosition(target: LatLng(33.5, -118.1), zoom: 5), ), diff --git a/lib/src/maplibre_map.dart b/lib/src/maplibre_map.dart index 71ebd8865..d4495bccf 100644 --- a/lib/src/maplibre_map.dart +++ b/lib/src/maplibre_map.dart @@ -29,12 +29,12 @@ class MaplibreMap extends StatefulWidget { this.dragEnabled = true, this.trackCameraPosition = false, this.myLocationEnabled = false, - this.myLocationTrackingMode = MyLocationTrackingMode.None, - this.myLocationRenderMode = MyLocationRenderMode.NORMAL, + this.myLocationTrackingMode = MyLocationTrackingMode.none, + this.myLocationRenderMode = MyLocationRenderMode.normal, this.logoViewMargins, this.compassViewPosition, this.compassViewMargins, - this.attributionButtonPosition = AttributionButtonPosition.BottomRight, + this.attributionButtonPosition = AttributionButtonPosition.bottomRight, this.attributionButtonMargins, this.iosLongClickDuration, this.onMapClick, @@ -57,7 +57,7 @@ class MaplibreMap extends StatefulWidget { AnnotationType.circle, ], }) : assert( - myLocationRenderMode != MyLocationRenderMode.NORMAL + myLocationRenderMode != MyLocationRenderMode.normal ? myLocationEnabled : true, "$myLocationRenderMode requires [myLocationEnabled] set to true.", @@ -176,7 +176,7 @@ class MaplibreMap extends StatefulWidget { /// Specifies if and how the user's heading/bearing is rendered in the user location indicator. /// See the documentation of [MyLocationRenderMode] for details. - /// If this is set to a value other than [MyLocationRenderMode.NORMAL], [myLocationEnabled] needs to be true. + /// If this is set to a value other than [MyLocationRenderMode.normal], [myLocationEnabled] needs to be true. final MyLocationRenderMode myLocationRenderMode; /// Set the layout margins for the Logo diff --git a/maplibre_gl_platform_interface/lib/src/ui.dart b/maplibre_gl_platform_interface/lib/src/ui.dart index bce3491ce..ce7f10586 100644 --- a/maplibre_gl_platform_interface/lib/src/ui.dart +++ b/maplibre_gl_platform_interface/lib/src/ui.dart @@ -6,43 +6,43 @@ part of '../maplibre_gl_platform_interface.dart'; class MaplibreStyles { /// A very simple MapLibre demo style - static const String DEMO = "https://demotiles.maplibre.org/style.json"; + static const String demo = "https://demotiles.maplibre.org/style.json"; } /// The camera mode, which determines how the map camera will track the rendered location. enum MyLocationTrackingMode { - None, - Tracking, - TrackingCompass, - TrackingGPS, + none, + tracking, + trackingCompass, + trackingGps, } /// Specifies if and how the user's heading/bearing is rendered in the user location indicator. enum MyLocationRenderMode { /// Do not show the user's heading/bearing. - NORMAL, + normal, /// Show the user's heading/bearing as determined by the device's compass. On iOS, this causes the user's location to be shown on the map. - COMPASS, + compass, /// Show the user's heading/bearing as determined by the device's GPS sensor. Not supported on iOS. - GPS, + gps, } /// Compass View Position enum CompassViewPosition { - TopLeft, - TopRight, - BottomLeft, - BottomRight, + topLeft, + topRight, + bottomLeft, + bottomRight, } /// Attribution Button Position enum AttributionButtonPosition { - TopLeft, - TopRight, - BottomLeft, - BottomRight, + topLeft, + topRight, + bottomLeft, + bottomRight, } /// Bounds for the map camera target. diff --git a/maplibre_gl_web/lib/src/convert.dart b/maplibre_gl_web/lib/src/convert.dart index af4c3f78e..65a62bfa0 100644 --- a/maplibre_gl_web/lib/src/convert.dart +++ b/maplibre_gl_web/lib/src/convert.dart @@ -71,7 +71,7 @@ class Convert { .values[options['attributionButtonPosition']]; sink.setAttributionButtonAlignment(position); } else { - sink.setAttributionButtonAlignment(AttributionButtonPosition.BottomRight); + sink.setAttributionButtonAlignment(AttributionButtonPosition.bottomRight); } if (options.containsKey('attributionButtonMargins')) { sink.setAttributionButtonMargins(options['attributionButtonMargins'][0], diff --git a/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart b/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart index 4afd49f89..0b938afef 100644 --- a/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart +++ b/maplibre_gl_web/lib/src/maplibre_web_gl_platform.dart @@ -477,9 +477,9 @@ class MaplibreMapController extends MapLibreGlPlatform void _onCameraTrackingChanged(bool isTracking) { if (isTracking) { - onCameraTrackingChangedPlatform(MyLocationTrackingMode.Tracking); + onCameraTrackingChangedPlatform(MyLocationTrackingMode.tracking); } else { - onCameraTrackingChangedPlatform(MyLocationTrackingMode.None); + onCameraTrackingChangedPlatform(MyLocationTrackingMode.none); } } @@ -538,16 +538,16 @@ class MaplibreMapController extends MapLibreGlPlatform String? positionString; switch (position) { - case CompassViewPosition.TopRight: + case CompassViewPosition.topRight: positionString = 'top-right'; break; - case CompassViewPosition.TopLeft: + case CompassViewPosition.topLeft: positionString = 'top-left'; break; - case CompassViewPosition.BottomRight: + case CompassViewPosition.bottomRight: positionString = 'bottom-right'; break; - case CompassViewPosition.BottomLeft: + case CompassViewPosition.bottomLeft: positionString = 'bottom-left'; break; default: @@ -584,16 +584,16 @@ class MaplibreMapController extends MapLibreGlPlatform ) { String? positionString; switch (position) { - case AttributionButtonPosition.TopRight: + case AttributionButtonPosition.topRight: positionString = 'top-right'; break; - case AttributionButtonPosition.TopLeft: + case AttributionButtonPosition.topLeft: positionString = 'top-left'; break; - case AttributionButtonPosition.BottomRight: + case AttributionButtonPosition.bottomRight: positionString = 'bottom-right'; break; - case AttributionButtonPosition.BottomLeft: + case AttributionButtonPosition.bottomLeft: positionString = 'bottom-left'; break; }