Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove maps launcher dependency

Neeraj Gupta5d04c9a92063
diff --git a/mobile/apps/photos/ios/Podfile.lock b/mobile/apps/photos/ios/Podfile.lock
index ca171a3e81..35e6473f24 100644
--- a/mobile/apps/photos/ios/Podfile.lock
+++ b/mobile/apps/photos/ios/Podfile.lock
@@ -151,8 +151,6 @@ PODS:
- Mantle (2.2.0):
- Mantle/extobjc (= 2.2.0)
- Mantle/extobjc (2.2.0)
- - maps_launcher (0.0.1):
- - Flutter
- media_extension (0.0.1):
- Flutter
- media_kit_libs_ios_video (1.0.4):
@@ -288,7 +286,6 @@ DEPENDENCIES:
- just_audio (from `.symlinks/plugins/just_audio/darwin`)
- launcher_icon_switcher (from `.symlinks/plugins/launcher_icon_switcher/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
- media_extension (from `.symlinks/plugins/media_extension/ios`)
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
@@ -409,8 +406,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/launcher_icon_switcher/ios"
local_auth_darwin:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
- maps_launcher:
- :path: ".symlinks/plugins/maps_launcher/ios"
media_extension:
:path: ".symlinks/plugins/media_extension/ios"
media_kit_libs_ios_video:
@@ -512,7 +507,6 @@ SPEC CHECKSUMS:
libwebp: 02b23773aedb6ff1fd38cec7a77b81414c6842a8
local_auth_darwin: c3ee6cce0a8d56be34c8ccb66ba31f7f180aaebb
Mantle: c5aa8794a29a022dfbbfc9799af95f477a69b62d
- maps_launcher: edf829809ba9e894d70e569bab11c16352dedb45
media_extension: 671e2567880d96c95c65c9a82ccceed8f2e309fd
media_kit_libs_ios_video: 5a18affdb97d1f5d466dc79988b13eff6c5e2854
media_kit_video: 1746e198cb697d1ffb734b1d05ec429d1fcd1474
diff --git a/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj b/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj
index 9e46943cf0..e7504ccaa1 100644
--- a/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj
+++ b/mobile/apps/photos/ios/Runner.xcodeproj/project.pbxproj
@@ -659,7 +659,6 @@
"${BUILT_PRODUCTS_DIR}/launcher_icon_switcher/launcher_icon_switcher.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
"${BUILT_PRODUCTS_DIR}/local_auth_darwin/local_auth_darwin.framework",
- "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework",
"${BUILT_PRODUCTS_DIR}/media_extension/media_extension.framework",
"${BUILT_PRODUCTS_DIR}/media_kit_libs_ios_video/media_kit_libs_ios_video.framework",
"${BUILT_PRODUCTS_DIR}/media_kit_video/media_kit_video.framework",
@@ -760,7 +759,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/launcher_icon_switcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_darwin.framework",
- "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/media_extension.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/media_kit_libs_ios_video.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/media_kit_video.framework",
diff --git a/mobile/apps/photos/lib/ui/map/map_view.dart b/mobile/apps/photos/lib/ui/map/map_view.dart
index dcd1cd057c..eba1db6901 100644
--- a/mobile/apps/photos/lib/ui/map/map_view.dart
+++ b/mobile/apps/photos/lib/ui/map/map_view.dart
@@ -1,15 +1,41 @@
+import "dart:io" show Platform;
+
import "package:ente_pure_utils/ente_pure_utils.dart";
import "package:flutter/material.dart";
import "package:flutter_map/flutter_map.dart";
import "package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart";
import "package:latlong2/latlong.dart";
-import "package:maps_launcher/maps_launcher.dart";
import "package:photos/ui/map/image_marker.dart";
import "package:photos/ui/map/map_button.dart";
import "package:photos/ui/map/map_gallery_tile.dart";
import "package:photos/ui/map/map_gallery_tile_badge.dart";
import "package:photos/ui/map/map_marker.dart";
import "package:photos/ui/map/tile/layers.dart";
+import "package:url_launcher/url_launcher.dart";
+
+Future<bool> _launchCoordinates(double latitude, double longitude) async {
+ final uri = Platform.isAndroid
+ ? Uri(
+ scheme: 'geo',
+ host: 'ul',
+ queryParameters: {'q': '$latitude,$longitude'},
+ )
+ : Uri.https('maps.apple.com', '/', {
+ 'll': '$latitude,$longitude',
+ 'q': '$latitude, $longitude',
+ });
+
+ final LaunchMode mode;
+ if (await supportsLaunchMode(LaunchMode.externalNonBrowserApplication)) {
+ mode = LaunchMode.externalNonBrowserApplication;
+ } else if (await supportsLaunchMode(LaunchMode.externalApplication)) {
+ mode = LaunchMode.externalApplication;
+ } else {
+ mode = LaunchMode.platformDefault;
+ }
+
+ return launchUrl(uri, mode: mode);
+}
class MapView extends StatefulWidget {
final List<ImageMarker> imageMarkers;
@@ -162,7 +188,7 @@ class _MapViewState extends State<MapView> {
child: MapButton(
icon: Icons.navigation_outlined,
onPressed: () {
- MapsLauncher.launchCoordinates(
+ _launchCoordinates(
widget.controller.camera.center.latitude,
widget.controller.camera.center.longitude,
);
diff --git a/mobile/apps/photos/pubspec.yaml b/mobile/apps/photos/pubspec.yaml
index 1f9db83a03..0335d5e821 100644
--- a/mobile/apps/photos/pubspec.yaml
+++ b/mobile/apps/photos/pubspec.yaml
@@ -155,7 +155,6 @@ dependencies:
path: ../../packages/log_viewer
logging: 1.3.0
lottie: 3.3.1
- maps_launcher: 3.0.0+1
media_extension:
git:
url: https://github.com/ente/media_extension.git
diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock
index 0d39ce3cab..b31eb22b1e 100644
--- a/mobile/pubspec.lock
+++ b/mobile/pubspec.lock
@@ -1658,14 +1658,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.3.1"
- maps_launcher:
- dependency: transitive
- description:
- name: maps_launcher
- sha256: dac4c609720211fa6336b5903d917fe45e545c6b5665978efc3db2a3f436b1ae
- url: "https://pub.dev"
- source: hosted
- version: "3.0.0+1"
matcher:
dependency: transitive
description: