Skip to content

Commit

Permalink
Upgrade 'latlong2' & 'http' dependencies (#1530)
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed May 23, 2023
1 parent 3e946d9 commit 64e3a8e
Show file tree
Hide file tree
Showing 49 changed files with 176 additions and 165 deletions.
8 changes: 4 additions & 4 deletions example/lib/pages/animated_map_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class AnimatedMapControllerPageState extends State<AnimatedMapControllerPage>
static const _inProgressId = 'AnimatedMapController#MoveInProgress';
static const _finishedId = 'AnimatedMapController#MoveFinished';

static final london = LatLng(51.5, -0.09);
static final paris = LatLng(48.8566, 2.3522);
static final dublin = LatLng(53.3498, -6.2603);
static const london = LatLng(51.5, -0.09);
static const paris = LatLng(48.8566, 2.3522);
static const dublin = LatLng(53.3498, -6.2603);

late final MapController mapController;

Expand Down Expand Up @@ -191,7 +191,7 @@ class AnimatedMapControllerPageState extends State<AnimatedMapControllerPage>
child: FlutterMap(
mapController: mapController,
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
maxZoom: 10,
minZoom: 3),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/circle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CirclePage extends StatelessWidget {
Widget build(BuildContext context) {
final circleMarkers = <CircleMarker>[
CircleMarker(
point: LatLng(51.5, -0.09),
point: const LatLng(51.5, -0.09),
color: Colors.blue.withOpacity(0.7),
borderStrokeWidth: 2,
useRadiusInMeter: true,
Expand All @@ -34,7 +34,7 @@ class CirclePage extends StatelessWidget {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 11,
),
children: [
Expand Down
12 changes: 6 additions & 6 deletions example/lib/pages/epsg3413_crs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
// These circles should have the same pixel radius on the map
final circles = [
CircleMarker(
point: LatLng(90, 0),
point: const LatLng(90, 0),
radius: 20000,
useRadiusInMeter: true,
color: Colors.yellow,
Expand All @@ -83,9 +83,9 @@ class _EPSG3413PageState extends State<EPSG3413Page> {

// Add latitude line at 80 degrees
final distancePoleToLat80 =
const Distance().distance(LatLng(90, 0), LatLng(80, 0));
const Distance().distance(const LatLng(90, 0), const LatLng(80, 0));
circles.add(CircleMarker(
point: LatLng(90, 0),
point: const LatLng(90, 0),
radius: distancePoleToLat80,
useRadiusInMeter: true,
color: Colors.transparent,
Expand Down Expand Up @@ -130,7 +130,7 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
child: FlutterMap(
options: MapOptions(
crs: epsg3413CRS,
center: LatLng(90, 0),
center: const LatLng(90, 0),
zoom: 3,
maxZoom: maxZoom,
),
Expand Down Expand Up @@ -168,8 +168,8 @@ class _EPSG3413PageState extends State<EPSG3413Page> {
overlayImages: [
OverlayImage(
bounds: LatLngBounds(
LatLng(72.7911372, 162.6196478),
LatLng(85.2802493, 79.794166),
const LatLng(72.7911372, 162.6196478),
const LatLng(85.2802493, 79.794166),
),
imageProvider: Image.asset(
'assets/map/epsg3413/amsr2.png',
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/epsg4326_crs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class EPSG4326Page extends StatelessWidget {
options: MapOptions(
minZoom: 0,
crs: const Epsg4326(),
center: LatLng(0, 0),
center: const LatLng(0, 0),
zoom: 0,
),
children: [
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/fallback_url_network_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FallbackUrlNetworkPage extends StatelessWidget {
description:
'Map with a fake url should use the fallback, showing (51.5, -0.9).',
zoom: 5,
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
);
}
}
2 changes: 1 addition & 1 deletion example/lib/pages/fallback_url_offline_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class FallbackUrlOfflinePage extends StatelessWidget {
'Map with a fake asset path, should be using the fallback to show Anholt Island, Denmark.',
maxZoom: 14,
minZoom: 12,
center: LatLng(56.704173, 11.543808),
center: const LatLng(56.704173, 11.543808),
);
}
}
8 changes: 4 additions & 4 deletions example/lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class HomePage extends StatelessWidget {
Marker(
width: 80,
height: 80,
point: LatLng(51.5, -0.09),
point: const LatLng(51.5, -0.09),
builder: (ctx) => const FlutterLogo(
textColor: Colors.blue,
key: ObjectKey(Colors.blue),
Expand All @@ -24,7 +24,7 @@ class HomePage extends StatelessWidget {
Marker(
width: 80,
height: 80,
point: LatLng(53.3498, -6.2603),
point: const LatLng(53.3498, -6.2603),
builder: (ctx) => const FlutterLogo(
textColor: Colors.green,
key: ObjectKey(Colors.green),
Expand All @@ -33,7 +33,7 @@ class HomePage extends StatelessWidget {
Marker(
width: 80,
height: 80,
point: LatLng(48.8566, 2.3522),
point: const LatLng(48.8566, 2.3522),
builder: (ctx) => const FlutterLogo(
textColor: Colors.purple,
key: ObjectKey(Colors.purple),
Expand All @@ -55,7 +55,7 @@ class HomePage extends StatelessWidget {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
),
nonRotatedChildren: [
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/interactive_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class _InteractiveTestPageState extends State<InteractiveTestPage> {
child: FlutterMap(
options: MapOptions(
onMapEvent: onMapEvent,
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 11,
interactiveFlags: flags,
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/latlng_to_screen_point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class _LatLngScreenPointTestPageState extends State<LatLngScreenPointTestPage> {
_textPos = CustomPoint(pt1!.x, pt1.y);
setState(() {});
},
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 11,
rotation: 0,
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/live_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class _LiveLocationPageState extends State<LiveLocationPage> {
currentLatLng =
LatLng(_currentLocation!.latitude!, _currentLocation!.longitude!);
} else {
currentLatLng = LatLng(0, 0);
currentLatLng = const LatLng(0, 0);
}

final markers = <Marker>[
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/many_markers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _ManyMarkersPageState extends State<ManyMarkersPage> {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(50, 20),
center: const LatLng(50, 20),
zoom: 5,
interactiveFlags: InteractiveFlag.all - InteractiveFlag.rotate,
),
Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/map_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class MapControllerPage extends StatefulWidget {
}
}

final LatLng london = LatLng(51.5, -0.09);
final LatLng paris = LatLng(48.8566, 2.3522);
final LatLng dublin = LatLng(53.3498, -6.2603);
const LatLng london = LatLng(51.5, -0.09);
const LatLng paris = LatLng(48.8566, 2.3522);
const LatLng dublin = LatLng(53.3498, -6.2603);

class MapControllerPageState extends State<MapControllerPage> {
late final MapController _mapController;
Expand Down Expand Up @@ -156,7 +156,7 @@ class MapControllerPageState extends State<MapControllerPage> {
child: FlutterMap(
mapController: _mapController,
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
maxZoom: 5,
minZoom: 3,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/map_inside_listview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MapInsideListViewPage extends StatelessWidget {
height: 300,
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
),
nonRotatedChildren: const [
Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/marker_anchor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ class MarkerAnchorPageState extends State<MarkerAnchorPage> {
Marker(
width: 80,
height: 80,
point: LatLng(51.5, -0.09),
point: const LatLng(51.5, -0.09),
builder: (ctx) => const FlutterLogo(),
anchorPos: anchorPos,
),
Marker(
width: 80,
height: 80,
point: LatLng(53.3498, -6.2603),
point: const LatLng(53.3498, -6.2603),
builder: (ctx) => const FlutterLogo(
textColor: Colors.green,
),
Expand All @@ -57,7 +57,7 @@ class MarkerAnchorPageState extends State<MarkerAnchorPage> {
Marker(
width: 80,
height: 80,
point: LatLng(48.8566, 2.3522),
point: const LatLng(48.8566, 2.3522),
builder: (ctx) => const FlutterLogo(textColor: Colors.purple),
anchorPos: anchorPos,
),
Expand Down Expand Up @@ -109,7 +109,7 @@ class MarkerAnchorPageState extends State<MarkerAnchorPage> {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
),
children: [
Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/marker_rotate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ class MarkerRotatePageState extends State<MarkerRotatePage> {
Marker(
width: 80,
height: 80,
point: LatLng(51.5, -0.09),
point: const LatLng(51.5, -0.09),
rotate: rotateMarkerLondon,
builder: (ctx) => const FlutterLogo(),
),
Marker(
width: 80,
height: 80,
point: LatLng(53.3498, -6.2603),
point: const LatLng(53.3498, -6.2603),
rotate: rotateMarkerDublin,
builder: (ctx) => const FlutterLogo(
textColor: Colors.green,
Expand All @@ -89,7 +89,7 @@ class MarkerRotatePageState extends State<MarkerRotatePage> {
Marker(
width: 80,
height: 80,
point: LatLng(48.8566, 2.3522),
point: const LatLng(48.8566, 2.3522),
rotate: rotateMarkerParis,
builder: (ctx) => const FlutterLogo(textColor: Colors.purple),
),
Expand Down Expand Up @@ -134,7 +134,7 @@ class MarkerRotatePageState extends State<MarkerRotatePage> {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
),
children: [
Expand Down
7 changes: 5 additions & 2 deletions example/lib/pages/max_bounds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ class MaxBoundsPage extends StatelessWidget {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(56.704173, 11.543808),
center: const LatLng(56.704173, 11.543808),
zoom: 3,
maxBounds: LatLngBounds(LatLng(-90, -180), LatLng(90, 180)),
maxBounds: LatLngBounds(
const LatLng(-90, -180),
const LatLng(90, 180),
),
screenSize: MediaQuery.of(context).size,
),
children: [
Expand Down
8 changes: 4 additions & 4 deletions example/lib/pages/moving_markers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class _MovingMarkersPageState extends State<MovingMarkersPage> {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
),
children: [
Expand All @@ -79,19 +79,19 @@ List<Marker> _markers = [
Marker(
width: 80,
height: 80,
point: LatLng(51.5, -0.09),
point: const LatLng(51.5, -0.09),
builder: (ctx) => const FlutterLogo(),
),
Marker(
width: 80,
height: 80,
point: LatLng(53.3498, -6.2603),
point: const LatLng(53.3498, -6.2603),
builder: (ctx) => const FlutterLogo(),
),
Marker(
width: 80,
height: 80,
point: LatLng(48.8566, 2.3522),
point: const LatLng(48.8566, 2.3522),
builder: (ctx) => const FlutterLogo(),
),
];
8 changes: 4 additions & 4 deletions example/lib/pages/network_tile_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class NetworkTileProviderPage extends StatelessWidget {
Marker(
width: 80,
height: 80,
point: LatLng(51.5, -0.09),
point: const LatLng(51.5, -0.09),
builder: (ctx) => const FlutterLogo(
textColor: Colors.blue,
key: ObjectKey(Colors.blue),
Expand All @@ -23,7 +23,7 @@ class NetworkTileProviderPage extends StatelessWidget {
Marker(
width: 80,
height: 80,
point: LatLng(53.3498, -6.2603),
point: const LatLng(53.3498, -6.2603),
builder: (ctx) => const FlutterLogo(
textColor: Colors.green,
key: ObjectKey(Colors.green),
Expand All @@ -32,7 +32,7 @@ class NetworkTileProviderPage extends StatelessWidget {
Marker(
width: 80,
height: 80,
point: LatLng(48.8566, 2.3522),
point: const LatLng(48.8566, 2.3522),
builder: (ctx) => const FlutterLogo(
textColor: Colors.purple,
key: ObjectKey(Colors.purple),
Expand Down Expand Up @@ -61,7 +61,7 @@ class NetworkTileProviderPage extends StatelessWidget {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(51.5, -0.09),
center: const LatLng(51.5, -0.09),
zoom: 5,
),
children: [
Expand Down
6 changes: 3 additions & 3 deletions example/lib/pages/offline_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class OfflineMapPage extends StatelessWidget {
Flexible(
child: FlutterMap(
options: MapOptions(
center: LatLng(56.704173, 11.543808),
center: const LatLng(56.704173, 11.543808),
minZoom: 12,
maxZoom: 14,
swPanBoundary: LatLng(56.6877, 11.5089),
nePanBoundary: LatLng(56.7378, 11.6644),
swPanBoundary: const LatLng(56.6877, 11.5089),
nePanBoundary: const LatLng(56.7378, 11.6644),
),
children: [
TileLayer(
Expand Down
Loading

0 comments on commit 64e3a8e

Please sign in to comment.