Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Migrating to flutter_map v6 (2)

ashilkn6c77901396ec
diff --git a/mobile/lib/ui/map/map_marker.dart b/mobile/lib/ui/map/map_marker.dart
index 0009370be1..d4518feb6f 100644
--- a/mobile/lib/ui/map/map_marker.dart
+++ b/mobile/lib/ui/map/map_marker.dart
@@ -12,7 +12,7 @@ Marker mapMarker(
}) {
return Marker(
//-6.5 is for taking in the height of the MarkerPointer
- anchorPos: AnchorPos.exactly(Anchor(markerSize.height / 2, -6.5)),
+ alignment: Alignment(markerSize.height / 2, -6.5),
key: Key(key),
width: markerSize.width,
height: markerSize.height,
@@ -20,7 +20,7 @@ Marker mapMarker(
imageMarker.latitude,
imageMarker.longitude,
),
- builder: (context) => MarkerImage(
+ child: MarkerImage(
file: imageMarker.imageFile,
seperator: (MapView.defaultMarkerSize.height + 10) -
(MapView.defaultMarkerSize.height - markerSize.height),
diff --git a/mobile/lib/ui/map/map_screen.dart b/mobile/lib/ui/map/map_screen.dart
index adb2d590d9..78120bd839 100644
--- a/mobile/lib/ui/map/map_screen.dart
+++ b/mobile/lib/ui/map/map_screen.dart
@@ -114,7 +114,7 @@ class _MapScreenState extends State<MapScreen> {
);
Timer(Duration(milliseconds: debounceDuration), () {
- calculateVisibleMarkers(mapController.bounds!);
+ calculateVisibleMarkers(mapController.camera.visibleBounds);
setState(() {
isLoading = false;
});
diff --git a/mobile/lib/ui/map/map_view.dart b/mobile/lib/ui/map/map_view.dart
index 2a8c0ed4c7..5286924c95 100644
--- a/mobile/lib/ui/map/map_view.dart
+++ b/mobile/lib/ui/map/map_view.dart
@@ -108,12 +108,10 @@ class _MapViewState extends State<MapView> {
maxClusterRadius: 100,
showPolygon: false,
size: widget.markerSize,
- fitBoundsOptions: const FitBoundsOptions(
- padding: EdgeInsets.all(80),
- ),
+ padding: const EdgeInsets.all(80),
markers: _markers,
onClusterTap: (_) {
- onChange(widget.controller.bounds!);
+ onChange(widget.controller.camera.visibleBounds);
},
builder: (context, List<Marker> markers) {
final index = int.parse(
@@ -164,8 +162,8 @@ class _MapViewState extends State<MapView> {
icon: Icons.add,
onPressed: () {
widget.controller.move(
- widget.controller.center,
- widget.controller.zoom + 1,
+ widget.controller.camera.center,
+ widget.controller.camera.zoom + 1,
);
},
heroTag: 'zoom-in',
@@ -174,8 +172,8 @@ class _MapViewState extends State<MapView> {
icon: Icons.remove,
onPressed: () {
widget.controller.move(
- widget.controller.center,
- widget.controller.zoom - 1,
+ widget.controller.camera.center,
+ widget.controller.camera.zoom - 1,
);
},
heroTag: 'zoom-out',
diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock
index 8b71025e9f..97f5780063 100644
--- a/mobile/pubspec.lock
+++ b/mobile/pubspec.lock
@@ -764,26 +764,26 @@ packages:
dependency: "direct main"
description:
name: flutter_map
- sha256: "5286f72f87deb132daa1489442d6cc46e986fc105cb727d9ae1b602b35b1d1f3"
+ sha256: "87cc8349b8fa5dccda5af50018c7374b6645334a0d680931c1fe11bce88fa5bb"
url: "https://pub.dev"
source: hosted
- version: "5.0.0"
+ version: "6.2.1"
flutter_map_marker_cluster:
dependency: "direct main"
description:
name: flutter_map_marker_cluster
- sha256: "14bb31b9dd3a759ab4a1ba320d19bbb554d8d7952c8812029c6f6b7bda956906"
+ sha256: a324f48da5ee83a3f29fd8d08b4b1e6e3114ff5c6cab910124d6a2e1f06f08cc
url: "https://pub.dev"
source: hosted
- version: "1.2.0"
+ version: "1.3.6"
flutter_map_marker_popup:
dependency: transitive
description:
name: flutter_map_marker_popup
- sha256: be209c68b19d4c10d9a2f5911e45f7c579624c43a353adb9bf0f2fec0cf30b8c
+ sha256: ec563bcbae24a18ac16815fb75ac5ab33ccba609e14db70e252a67de19c6639c
url: "https://pub.dev"
source: hosted
- version: "5.2.0"
+ version: "6.1.2"
flutter_native_splash:
dependency: "direct main"
description:
@@ -1252,6 +1252,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.10"
+ logger:
+ dependency: transitive
+ description:
+ name: logger
+ sha256: af05cc8714f356fd1f3888fb6741cbe9fbe25cdb6eedbab80e1a6db21047d4a4
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.3.0"
logging:
dependency: "direct main"
description:
diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml
index ed3bf47193..123ba3f2fe 100644
--- a/mobile/pubspec.yaml
+++ b/mobile/pubspec.yaml
@@ -83,8 +83,8 @@ dependencies:
flutter_local_notifications: ^17.0.0
flutter_localizations:
sdk: flutter
- flutter_map: ^5.0.0
- flutter_map_marker_cluster: ^1.2.0
+ flutter_map: ^6.2.0
+ flutter_map_marker_cluster: ^1.3.6
flutter_native_splash: ^2.2.0+1
flutter_password_strength: ^0.1.6
flutter_secure_storage: ^8.0.0