Skip to content

Commit

Permalink
Use Object.all instead of hashValues
Browse files Browse the repository at this point in the history
  • Loading branch information
irvine5k committed Dec 13, 2024
1 parent b2bfef6 commit d5a0c90
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion mapbox_gl_platform_interface/lib/src/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class CameraPosition {
}

@override
int get hashCode => hashValues(bearing, target, tilt, zoom);
int get hashCode => Object.hashAll([bearing, target, tilt, zoom]);

@override
String toString() =>
Expand Down
13 changes: 5 additions & 8 deletions mapbox_gl_platform_interface/lib/src/location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class LatLng {
/// The longitude is normalized to the half-open interval from -180.0
/// (inclusive) to +180.0 (exclusive)
const LatLng(double latitude, double longitude)
: latitude =
(latitude < -90.0 ? -90.0 : (90.0 < latitude ? 90.0 : latitude)),
: latitude = (latitude < -90.0 ? -90.0 : (90.0 < latitude ? 90.0 : latitude)),
longitude = (longitude + 180.0) % 360.0 - 180.0;

/// The latitude in degrees between -90.0 and 90.0, both inclusive.
Expand Down Expand Up @@ -53,7 +52,7 @@ class LatLng {
}

@override
int get hashCode => hashValues(latitude, longitude);
int get hashCode => Object.hashAll([latitude, longitude]);
}

/// A latitude/longitude aligned rectangle.
Expand Down Expand Up @@ -100,13 +99,11 @@ class LatLngBounds {

@override
bool operator ==(Object o) {
return o is LatLngBounds &&
o.southwest == southwest &&
o.northeast == northeast;
return o is LatLngBounds && o.southwest == southwest && o.northeast == northeast;
}

@override
int get hashCode => hashValues(southwest, northeast);
int get hashCode => Object.hashAll([southwest, northeast]);
}

/// A geographical area representing a non-aligned quadrilateral
Expand Down Expand Up @@ -164,7 +161,7 @@ class LatLngQuad {
}

@override
int get hashCode => hashValues(topLeft, topRight, bottomRight, bottomLeft);
int get hashCode => Object.hashAll([topLeft, topRight, bottomRight, bottomLeft]);
}

/// User's observed location
Expand Down
8 changes: 3 additions & 5 deletions mapbox_gl_platform_interface/lib/src/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class MapboxStyles {
/// Satellite Streets: Global satellite and aerial imagery with unobtrusive labels. Using this
/// constant means your map style will always use the latest version and may change as we
/// improve the style.
static const String SATELLITE_STREETS =
"mapbox://styles/mapbox/satellite-streets-v11";
static const String SATELLITE_STREETS = "mapbox://styles/mapbox/satellite-streets-v11";

/// Traffic Day: Color-coded roads based on live traffic congestion data. Traffic data is currently
/// available in
Expand Down Expand Up @@ -129,8 +128,7 @@ class MinMaxZoomPreference {
final double? maxZoom;

/// Unbounded zooming.
static const MinMaxZoomPreference unbounded =
MinMaxZoomPreference(null, null);
static const MinMaxZoomPreference unbounded = MinMaxZoomPreference(null, null);

dynamic toJson() => <dynamic>[minZoom, maxZoom];

Expand All @@ -143,7 +141,7 @@ class MinMaxZoomPreference {
}

@override
int get hashCode => hashValues(minZoom, maxZoom);
int get hashCode => Object.hashAll([minZoom, maxZoom]);

@override
String toString() {
Expand Down
2 changes: 1 addition & 1 deletion mapbox_gl_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ dependencies:
meta: ^1.0.5

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.14.0 <3.0.0'
flutter: ">=2.0.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ flutter:
default_package: mapbox_gl_web

environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=2.14.0 <3.0.0'
# Flutter versions prior to 1.10 did not support the flutter.plugin.platforms map.
flutter: ">=2.0.0"

0 comments on commit d5a0c90

Please sign in to comment.