Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mobile): upgrade maplibre_gl package to fix issue with crash in ios7.4 above simulator #10182

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ PODS:
- fluttertoast (0.0.2):
- Flutter
- Toast
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- FMDB (2.7.11):
- FMDB/standard (= 2.7.11)
- FMDB/standard (2.7.11)
- geolocator_apple (1.2.0):
- Flutter
- image_picker_ios (0.0.1):
Expand All @@ -28,10 +28,10 @@ PODS:
- Flutter
- isar_flutter_libs (1.0.0):
- Flutter
- MapLibre (5.14.0-pre3)
- MapLibre (6.5.0)
- maplibre_gl (0.0.1):
- Flutter
- MapLibre (= 5.14.0-pre3)
- MapLibre (= 6.5.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand All @@ -44,7 +44,7 @@ PODS:
- photo_manager (2.0.0):
- Flutter
- FlutterMacOS
- ReachabilitySwift (5.0.0)
- ReachabilitySwift (5.2.3)
- SAMKeychain (1.5.3)
- share_plus (0.0.1):
- Flutter
Expand All @@ -54,7 +54,7 @@ PODS:
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
- Toast (4.0.0)
- Toast (4.1.1)
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
Expand Down Expand Up @@ -156,24 +156,24 @@ SPEC CHECKSUMS:
flutter_udid: a2482c67a61b9c806ef59dd82ed8d007f1b7ac04
flutter_web_auth: c25208760459cec375a3c39f6a8759165ca0fa4d
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
FMDB: 57486c1117fd8e0e6b947b2f54c3f42bf8e57a4e
geolocator_apple: 9157311f654584b9bb72686c55fc02a97b73f461
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
isar_flutter_libs: b69f437aeab9c521821c3f376198c4371fa21073
MapLibre: 620fc933c1d6029b33738c905c1490d024e5d4ef
maplibre_gl: a2efec727dd340e4c65e26d2b03b584f14881fd9
MapLibre: 0ebfa9329d313cec8bf0a5ba5a336a1dc903785e
maplibre_gl: 943a491fffb3337c1b9de57fd377206d18c16e34
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
photo_manager: 4f6810b7dfc4feb03b461ac1a70dacf91fba7604
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979
SAMKeychain: 483e1c9f32984d50ca961e26818a534283b4cd5c
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
Expand Down
2 changes: 1 addition & 1 deletion mobile/lib/extensions/maplibrecontroller_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:immich_mobile/models/map/map_marker.model.dart';
import 'package:immich_mobile/utils/map_utils.dart';
import 'package:maplibre_gl/maplibre_gl.dart';

extension MapMarkers on MaplibreMapController {
extension MapMarkers on MapLibreMapController {
static var _completer = Completer()..complete();

Future<void> addGeoJSONSourceForMarkers(List<MapMarker> markers) async {
Expand Down
8 changes: 4 additions & 4 deletions mobile/lib/pages/search/map/map.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MapPage extends HookConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final mapController = useRef<MaplibreMapController?>(null);
final mapController = useRef<MapLibreMapController?>(null);
final markers = useRef<List<MapMarker>>([]);
final markersInBounds = useRef<List<MapMarker>>([]);
final bottomSheetStreamController = useStreamController<MapEvent>();
Expand Down Expand Up @@ -155,7 +155,7 @@ class MapPage extends HookConsumerWidget {
}
}

void onMapCreated(MaplibreMapController controller) async {
void onMapCreated(MapLibreMapController controller) async {
mapController.value = controller;
controller.addListener(() {
if (controller.isCameraMoving && selectedMarker.value != null) {
Expand Down Expand Up @@ -373,7 +373,7 @@ class _MapWithMarker extends StatelessWidget {
child: Stack(
children: [
style.widgetWhen(
onData: (style) => MaplibreMap(
onData: (style) => MapLibreMap(
initialCameraPosition:
const CameraPosition(target: LatLng(0, 0)),
styleString: style,
Expand All @@ -387,7 +387,7 @@ class _MapWithMarker extends StatelessWidget {
tiltGesturesEnabled: false,
dragEnabled: false,
myLocationEnabled: false,
attributionButtonPosition: AttributionButtonPosition.TopRight,
attributionButtonPosition: AttributionButtonPosition.topRight,
rotateGesturesEnabled: false,
),
),
Expand Down
4 changes: 2 additions & 2 deletions mobile/lib/pages/search/map/map_location_picker.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MapLocationPickerPage extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final selectedLatLng = useValueNotifier<LatLng>(initialLatLng);
final controller = useRef<MaplibreMapController?>(null);
final controller = useRef<MapLibreMapController?>(null);
final marker = useRef<Symbol?>(null);

Future<void> onStyleLoaded() async {
Expand Down Expand Up @@ -74,7 +74,7 @@ class MapLocationPickerPage extends HookConsumerWidget {
bottomRight: Radius.circular(40),
),
),
child: MaplibreMap(
child: MapLibreMap(
initialCameraPosition:
CameraPosition(target: initialLatLng, zoom: 12),
styleString: style,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final getAllPlacesProvider =
final curatedContent = assetPlaces
.map(
(data) => SearchCuratedContent(
label: data.exifInfo!.city!,
label: data.exifInfo?.city ?? '',
id: data.id,
),
)
Expand Down
6 changes: 3 additions & 3 deletions mobile/lib/widgets/map/map_thumbnail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class MapThumbnail extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final offsettedCentre = LatLng(centre.latitude + 0.002, centre.longitude);
final controller = useRef<MaplibreMapController?>(null);
final controller = useRef<MapLibreMapController?>(null);
final position = useValueNotifier<Point<num>?>(null);

Future<void> onMapCreated(MaplibreMapController mapController) async {
Future<void> onMapCreated(MapLibreMapController mapController) async {
controller.value = mapController;
if (assetMarkerRemoteId != null) {
// The iOS impl returns wrong toScreenLocation without the delay
Expand Down Expand Up @@ -73,7 +73,7 @@ class MapThumbnail extends HookConsumerWidget {
alignment: Alignment.center,
children: [
style.widgetWhen(
onData: (style) => MaplibreMap(
onData: (style) => MapLibreMap(
initialCameraPosition:
CameraPosition(target: offsettedCentre, zoom: zoom),
styleString: style,
Expand Down
33 changes: 15 additions & 18 deletions mobile/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -911,30 +911,27 @@ packages:
maplibre_gl:
dependency: "direct main"
description:
path: "."
ref: acb428a005efd9832a0a8e7ef0945f899dfb3ca5
resolved-ref: acb428a005efd9832a0a8e7ef0945f899dfb3ca5
url: "https://github.com/maplibre/flutter-maplibre-gl.git"
source: git
version: "0.18.0"
name: maplibre_gl
sha256: ea2fa443e7d5dc18db7f37a0f6f5af40642888c56b81a14441aeddea077adaea
url: "https://pub.dev"
source: hosted
version: "0.20.0"
maplibre_gl_platform_interface:
dependency: transitive
description:
path: maplibre_gl_platform_interface
ref: main
resolved-ref: acb428a005efd9832a0a8e7ef0945f899dfb3ca5
url: "https://github.com/maplibre/flutter-maplibre-gl.git"
source: git
version: "0.18.0"
name: maplibre_gl_platform_interface
sha256: "718c3503f36936fbf35c34d6ddf8bf770474c5ba1e6cb1d8caece44efae424af"
url: "https://pub.dev"
source: hosted
version: "0.20.0"
maplibre_gl_web:
dependency: transitive
description:
path: maplibre_gl_web
ref: main
resolved-ref: acb428a005efd9832a0a8e7ef0945f899dfb3ca5
url: "https://github.com/maplibre/flutter-maplibre-gl.git"
source: git
version: "0.18.0"
name: maplibre_gl_web
sha256: e7d71b08f24dca70e9c9cf841b096704a677e6239447d87220ec071355768149
url: "https://pub.dev"
source: hosted
version: "0.20.0"
matcher:
dependency: transitive
description:
Expand Down
6 changes: 1 addition & 5 deletions mobile/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ dependencies:
video_player: ^2.8.2
chewie: ^1.7.4
socket_io_client: ^2.0.3+1
# TODO: Update it to tag once next stable release
maplibre_gl:
git:
url: https://github.com/maplibre/flutter-maplibre-gl.git
ref: acb428a005efd9832a0a8e7ef0945f899dfb3ca5
maplibre_gl: ^0.20.0
geolocator: ^11.0.0 # used to move to current location in map view
flutter_udid: ^3.0.0
flutter_svg: ^2.0.9
Expand Down
Loading