From 9c58be85ff2c24b856588216545fe22a6c8fb77a Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 17 Dec 2025 16:26:02 +0200 Subject: [PATCH 01/15] feat: upgrade google_navigation_flutter sdk --- README.md | 6 +++--- android/build.gradle | 4 ++-- example/pubspec.yaml | 3 +-- pubspec.yaml | 6 +++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1f40838..da7ef21 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ This repository contains a Flutter plugin that allows users to use the [Google M ## Requirements -| | Android | iOS | -| ----------- | ------- | --------- | -| **Support** | SDK 23+ | iOS 16.0+ | +| | Android | iOS | +| ----------- | ------------- | --------- | +| **Support** | API level 24+ | iOS 16.0+ | * A Flutter project * A Google Cloud project with the [Navigation SDK enabled](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project), the [Maps SDK for iOS enabled](https://developers.google.com/maps/documentation/navigation/ios-sdk/config) and the [Local Rides and Deliveries API enabled](https://console.developers.google.com/apis/library/fleetengine.googleapis.com) diff --git a/android/build.gradle b/android/build.gradle index 8230a5a..c5c97ec 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -50,7 +50,7 @@ android { namespace 'com.google.maps.flutter.driver' } - compileSdk 34 + compileSdk 35 compileOptions { sourceCompatibility JavaVersion.VERSION_11 @@ -67,7 +67,7 @@ android { } defaultConfig { - minSdkVersion 23 + minSdkVersion 24 } dependencies { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 8e28aad..4cc5b7f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -17,7 +17,7 @@ description: Demonstrates how to use the google_driver_flutter plugin. publish_to: "none" environment: - sdk: ^3.7.0 + sdk: ^3.8.0 dependencies: cupertino_icons: ^1.0.8 @@ -25,7 +25,6 @@ dependencies: sdk: flutter google_driver_flutter: path: ../ - google_navigation_flutter: ^0.6.2 http: ^1.1.2 permission_handler: ^11.3.1 diff --git a/pubspec.yaml b/pubspec.yaml index 6320e2a..07a2f98 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -18,13 +18,13 @@ version: 0.4.0 publish_to: none environment: - sdk: ^3.7.0 - flutter: ">=3.29.0" + sdk: ^3.8.0 + flutter: ">=3.32.0" dependencies: flutter: sdk: flutter - google_navigation_flutter: ^0.6.2 + google_navigation_flutter: ^0.8.0 dev_dependencies: build_runner: ^2.4.6 From 68d55e9615819f8f7bff542a909b9db8ef2b6c91 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 17 Dec 2025 16:36:38 +0200 Subject: [PATCH 02/15] chore: upgrade example project files for iOS --- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 22 ++++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 23 +++++++++++++++++++ .../xcshareddata/xcschemes/Runner.xcscheme | 18 +++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index b3aaa73..1f6b98f 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -25,6 +25,6 @@ arm64 MinimumOSVersion - 12.0 + 13.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 141d5b0..9c1f730 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; C452657B2B6D7C440048CA35 /* ConvertTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C452657A2B6D7C440048CA35 /* ConvertTests.swift */; }; C9FA8D662B28F632000BE7BA /* RunnerUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = C9FA8D652B28F632000BE7BA /* RunnerUITests.m */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -80,6 +81,7 @@ C9FA8D652B28F632000BE7BA /* RunnerUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RunnerUITests.m; sourceTree = ""; }; E47379614476E0B75506E185 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; E58CFEAAF613A41CF2C03AE3 /* Pods-Runner-RunnerUITests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner-RunnerUITests.profile.xcconfig"; path = "Target Support Files/Pods-Runner-RunnerUITests/Pods-Runner-RunnerUITests.profile.xcconfig"; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -95,6 +97,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 36BC17309B3E51BB1DF47C5F /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -147,6 +150,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -224,6 +228,9 @@ productType = "com.apple.product-type.bundle.unit-test"; }; 97C146ED1CF9000F007C117D /* Runner */ = { + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( @@ -271,6 +278,9 @@ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; @@ -990,6 +1000,18 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..3e19e31 --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,23 @@ +{ + "pins" : [ + { + "identity" : "ios-maps-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-maps-sdk", + "state" : { + "revision" : "71e09fe4c751d59d7b1e524e998f786b429b1b14", + "version" : "10.6.0" + } + }, + { + "identity" : "ios-navigation-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-navigation-sdk", + "state" : { + "revision" : "bcee02b433831d29d1ac12a62038fd009c333f7b", + "version" : "10.6.0" + } + } + ], + "version" : 2 +} diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index ce3f125..cbb606b 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + Date: Wed, 17 Dec 2025 16:37:10 +0200 Subject: [PATCH 03/15] feat: upgrade Driver SDK for Android from 6.2.0 to 7.0.0 --- README.md | 7 ++++--- android/build.gradle | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index da7ef21..264f1ca 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,10 @@ This repository contains a Flutter plugin that allows users to use the [Google M ## Requirements -| | Android | iOS | -| ----------- | ------------- | --------- | -| **Support** | API level 24+ | iOS 16.0+ | +| | Android | iOS | +| ------------------------------- | ------------- | --------- | +| **Minimum mobile OS supported** | API level 26+ | iOS 16.0+ | +| **Target SDK** | 36 | - | * A Flutter project * A Google Cloud project with the [Navigation SDK enabled](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project), the [Maps SDK for iOS enabled](https://developers.google.com/maps/documentation/navigation/ios-sdk/config) and the [Local Rides and Deliveries API enabled](https://console.developers.google.com/apis/library/fleetengine.googleapis.com) diff --git a/android/build.gradle b/android/build.gradle index c5c97ec..db04ab4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -50,7 +50,7 @@ android { namespace 'com.google.maps.flutter.driver' } - compileSdk 35 + compileSdk 36 compileOptions { sourceCompatibility JavaVersion.VERSION_11 @@ -67,11 +67,11 @@ android { } defaultConfig { - minSdkVersion 24 + minSdkVersion 26 } dependencies { - implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:6.2.0' + implementation 'com.google.android.libraries.mapsplatform.transportation:transportation-driver:7.0.0' testImplementation 'org.jetbrains.kotlin:kotlin-test' testImplementation 'io.mockk:mockk:1.13.9' testImplementation 'junit:junit:4.13.2' From 76744dee0300ebc5e0ef6ea581406903b1aa2792 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 17 Dec 2025 16:48:47 +0200 Subject: [PATCH 04/15] chore: reformat with latest flutter version --- .../plugin_integration_test.dart | 47 +++--- example/integration_test/shared.dart | 9 +- example/lib/api/lmfs_api.dart | 5 +- example/lib/api/lmfs_helpers.dart | 59 ++++---- example/lib/api/lmfs_types.dart | 40 +++-- example/lib/api/odrd_helpers.dart | 12 +- example/lib/api/odrd_types.dart | 63 ++++---- example/lib/main.dart | 11 +- example/lib/pages/lmfs_driver.dart | 138 +++++++++--------- example/lib/pages/odrd_driver.dart | 134 ++++++++--------- example/lib/utils/overlay_options.dart | 5 +- example/lib/widgets/dropdown_button.dart | 7 +- example/lib/widgets/page.dart | 45 +++--- example/lib/widgets/slider_editor.dart | 11 +- example/pubspec.yaml | 1 + ios/Classes/AccessTokenProvider.swift | 4 +- lib/src/google_driver_flutter.dart | 6 +- .../convert/delivery_vehicle.dart | 9 +- .../method_channel/convert/vehiclestop.dart | 7 +- .../method_channel/convert/vehicleupdate.dart | 7 +- lib/src/method_channel/messages.g.dart | 30 ++-- test/google_driver_flutter_test.dart | 12 +- test/messages_test.g.dart | 27 ++-- 23 files changed, 333 insertions(+), 356 deletions(-) diff --git a/example/integration_test/plugin_integration_test.dart b/example/integration_test/plugin_integration_test.dart index 298437a..3365644 100644 --- a/example/integration_test/plugin_integration_test.dart +++ b/example/integration_test/plugin_integration_test.dart @@ -312,33 +312,32 @@ void main() { return tokenResponse!.token; } }, - onStatusUpdate: - Platform.isAndroid - ? ( - DriverStatusLevel level, - DriverStatusCode code, - String message, - DriverException? exception, - ) { - if (listeningStatus) { - reportedLevel = level; - reportedCode = code; - reportedMessage = message; - reportedException = exception; - - if (code == DriverStatusCode.defaultStatus) { - if (level == DriverStatusLevel.debug && - message == 'Successful update.') { - successCount = successCount + 1; - successCompleter.complete(); - } - } else { - failureCount = failureCount + 1; - failureCompleter.complete(); + onStatusUpdate: Platform.isAndroid + ? ( + DriverStatusLevel level, + DriverStatusCode code, + String message, + DriverException? exception, + ) { + if (listeningStatus) { + reportedLevel = level; + reportedCode = code; + reportedMessage = message; + reportedException = exception; + + if (code == DriverStatusCode.defaultStatus) { + if (level == DriverStatusLevel.debug && + message == 'Successful update.') { + successCount = successCount + 1; + successCompleter.complete(); } + } else { + failureCount = failureCount + 1; + failureCompleter.complete(); } } - : null, + } + : null, abnormalTerminationReportingEnabled: true, ); await $.pumpAndSettle(); diff --git a/example/integration_test/shared.dart b/example/integration_test/shared.dart index 9621519..0d0e815 100644 --- a/example/integration_test/shared.dart +++ b/example/integration_test/shared.dart @@ -42,7 +42,9 @@ Future pumpNavigationView( /// Wraps a [navigationView] in widgets. Widget wrapNavigationView(GoogleMapsNavigationView navigationView) { - return MaterialApp(home: Scaffold(body: Center(child: navigationView))); + return MaterialApp( + home: Scaffold(body: Center(child: navigationView)), + ); } Future checkTermsAndConditionsAcceptance( @@ -76,8 +78,9 @@ Future checkTermsAndConditionsAcceptance( Future checkLocationDialogAcceptance(PatrolIntegrationTester $) async { if (!await Permission.locationWhenInUse.isGranted) { /// Request native location permission dialog.q - final Future locationGranted = - Permission.locationWhenInUse.request(); + final Future locationGranted = Permission + .locationWhenInUse + .request(); // Grant location permission. await $.native.grantPermissionWhenInUse(); diff --git a/example/lib/api/lmfs_api.dart b/example/lib/api/lmfs_api.dart index 935e74e..e8188d8 100644 --- a/example/lib/api/lmfs_api.dart +++ b/example/lib/api/lmfs_api.dart @@ -40,8 +40,9 @@ class LMFSApi extends ApiClient { LMFSManifestUpdate manifestDetails, String? vehicleId, ) async { - final String endpoint = - vehicleId != null ? 'manifest/$vehicleId' : 'manifest'; + final String endpoint = vehicleId != null + ? 'manifest/$vehicleId' + : 'manifest'; final String response = await post(endpoint, manifestDetails.toJson()); return LMFSManifest.fromJson(jsonDecode(response) as Map); } diff --git a/example/lib/api/lmfs_helpers.dart b/example/lib/api/lmfs_helpers.dart index 83d5492..4be5486 100644 --- a/example/lib/api/lmfs_helpers.dart +++ b/example/lib/api/lmfs_helpers.dart @@ -46,8 +46,9 @@ LMFSDeliveryConfig? get lmfsDeliveryConfig => _lmfsDeliveryConfig; /// Returns the same instance of [LMFSApi] every time. LMFSApi getLMFSApi() { if (_lmfsApiInstance == null) { - final String baseUrl = - Platform.isAndroid ? _lmfsAndroidBaseUrl : _lmfsiOSBaseUrl; + final String baseUrl = Platform.isAndroid + ? _lmfsAndroidBaseUrl + : _lmfsiOSBaseUrl; _lmfsApiInstance = LMFSApi(baseUrl); } return _lmfsApiInstance!; @@ -140,38 +141,36 @@ Future completeFirstLMFSStop(LMFSManifest manifest) async { remainingStopIdList: manifest.remainingStopIdList, ); update.remainingStopIdList!.removeAt(0); - update.currentStopState = - update.remainingStopIdList!.isEmpty ? null : VehicleStopState.newStop; + update.currentStopState = update.remainingStopIdList!.isEmpty + ? null + : VehicleStopState.newStop; return getLMFSApi().updateManifest(update, manifest.vehicle.vehicleId); } /// Returns the list of [VehicleStop] objects from the given [LMFSManifest]. List getStopsFromLMFSManifest(LMFSManifest manifest) { - final List stops = - manifest.stops - .where( - (LMFSStop stop) => - manifest.remainingStopIdList?.contains(stop.stopId) ?? false, - ) - .map( - (LMFSStop stop) => VehicleStop( - vehicleStopState: - stop.stopId == manifest.remainingStopIdList?.first - ? (manifest.currentStopState ?? VehicleStopState.newStop) - : VehicleStopState.newStop, - waypoint: stop.plannedWaypoint.toNavigationWaypoint(), - taskInfoList: - stop.taskIds.map((String taskId) { - final LMFSTask task = manifest.tasks.firstWhere( - (LMFSTask task) => task.taskId == taskId, - ); - return TaskInfo( - taskId: taskId, - durationSeconds: task.durationSeconds, - ); - }).toList(), - ), - ) - .toList(); + final List stops = manifest.stops + .where( + (LMFSStop stop) => + manifest.remainingStopIdList?.contains(stop.stopId) ?? false, + ) + .map( + (LMFSStop stop) => VehicleStop( + vehicleStopState: stop.stopId == manifest.remainingStopIdList?.first + ? (manifest.currentStopState ?? VehicleStopState.newStop) + : VehicleStopState.newStop, + waypoint: stop.plannedWaypoint.toNavigationWaypoint(), + taskInfoList: stop.taskIds.map((String taskId) { + final LMFSTask task = manifest.tasks.firstWhere( + (LMFSTask task) => task.taskId == taskId, + ); + return TaskInfo( + taskId: taskId, + durationSeconds: task.durationSeconds, + ); + }).toList(), + ), + ) + .toList(); return stops; } diff --git a/example/lib/api/lmfs_types.dart b/example/lib/api/lmfs_types.dart index 0712314..70fd1aa 100644 --- a/example/lib/api/lmfs_types.dart +++ b/example/lib/api/lmfs_types.dart @@ -59,10 +59,9 @@ class LMFSDeliveryConfig { factory LMFSDeliveryConfig.fromJson(Map json) { return LMFSDeliveryConfig( description: json['description'] as String, - manifests: - (json['manifests'] as List>) - .map((Map e) => LMFSManifest.fromJson(e)) - .toList(), + manifests: (json['manifests'] as List>) + .map((Map e) => LMFSManifest.fromJson(e)) + .toList(), ); } @@ -185,12 +184,11 @@ class LMFSManifest { return LMFSManifest( vehicle: LMFSVehicle.fromJson(json['vehicle'] as Map), clientId: json['client_id'] as String?, - currentStopState: - json['current_stop_state'] != null - ? VehicleStopStateJsonConversion.fromJsonString( - json['current_stop_state'] as String, - ) - : null, + currentStopState: json['current_stop_state'] != null + ? VehicleStopStateJsonConversion.fromJsonString( + json['current_stop_state'] as String, + ) + : null, remainingStopIdList: List.from( json['remaining_stop_id_list'] as List, ), @@ -285,12 +283,11 @@ class LMFSVehicle extends Vehicle { return LMFSVehicle( vehicleId: json['vehicle_id'] as String, providerId: json['provider_id'] as String, - startLocation: - json['start_location'] != null - ? LMFSWaypoint.fromJson( - json['start_location'] as Map, - ) - : null, + startLocation: json['start_location'] != null + ? LMFSWaypoint.fromJson( + json['start_location'] as Map, + ) + : null, ); } } @@ -484,12 +481,11 @@ class LMFSTask { plannedCompletionTimeRangeSeconds: json['planned_completion_time_range_seconds'] as int?, durationSeconds: json['duration_seconds'] as int, - taskType: - json['taskType'] != null - ? LMFSTaskTypeJsonConversion.fromJsonString( - json['taskType'] as String, - ) - : null, + taskType: json['taskType'] != null + ? LMFSTaskTypeJsonConversion.fromJsonString( + json['taskType'] as String, + ) + : null, description: json['description'] as String?, ); } diff --git a/example/lib/api/odrd_helpers.dart b/example/lib/api/odrd_helpers.dart index 9634315..156c5c4 100644 --- a/example/lib/api/odrd_helpers.dart +++ b/example/lib/api/odrd_helpers.dart @@ -41,8 +41,9 @@ ODRDApi? _odrdApiInstance; /// Returns the same instance of [ODRDApi] every time. ODRDApi getODRDApi() { if (_odrdApiInstance == null) { - final String baseUrl = - Platform.isAndroid ? _odrdAndroidBaseUrl : _odrdiOSBaseUrl; + final String baseUrl = Platform.isAndroid + ? _odrdAndroidBaseUrl + : _odrdiOSBaseUrl; _odrdApiInstance = ODRDApi(baseUrl); } return _odrdApiInstance!; @@ -71,10 +72,9 @@ Future createODRDTrip({ triptype: triptype ?? ODRDTripType.exclusive, pickup: pickup.target!, dropoff: dropoff.target!, - intermediateDestinations: - intermediateDestinations - ?.map((NavigationWaypoint e) => e.target!) - .toList(), + intermediateDestinations: intermediateDestinations + ?.map((NavigationWaypoint e) => e.target!) + .toList(), ); final ODRDTrip trip = await odrdApi.createTrip(createTrip); diff --git a/example/lib/api/odrd_types.dart b/example/lib/api/odrd_types.dart index eec8819..f4d8fb5 100644 --- a/example/lib/api/odrd_types.dart +++ b/example/lib/api/odrd_types.dart @@ -102,32 +102,26 @@ class ODRDVehicle extends Vehicle { json['vehicleState'] as String, ), name: json['name'] as String?, - currentTripsIds: - (json['currentTripsIds'] as List?) - ?.map((dynamic e) => e as String) - .toList(), - waypoints: - (json['waypoints'] as List?) - ?.map( - (dynamic e) => ODRDWaypoint.fromJson(e as Map), - ) - .toList(), - supportedTripTypes: - (json['supportedTripTypes'] as List?) - ?.map( - (dynamic e) => - ODRDTripTypesJsonConversion.fromJsonString(e as String), - ) - .toList(), + currentTripsIds: (json['currentTripsIds'] as List?) + ?.map((dynamic e) => e as String) + .toList(), + waypoints: (json['waypoints'] as List?) + ?.map((dynamic e) => ODRDWaypoint.fromJson(e as Map)) + .toList(), + supportedTripTypes: (json['supportedTripTypes'] as List?) + ?.map( + (dynamic e) => + ODRDTripTypesJsonConversion.fromJsonString(e as String), + ) + .toList(), backToBackEnabled: json['backToBackEnabled'] as bool?, maximumCapacity: json['maximumCapacity'] as int?, - lastLocation: - json['lastLocation'] == null - ? null - : LatLngJsonConversion.fromJson( - (json['lastLocation'] as Map)['point'] - as Map, - ), + lastLocation: json['lastLocation'] == null + ? null + : LatLngJsonConversion.fromJson( + (json['lastLocation'] as Map)['point'] + as Map, + ), ); } @@ -138,10 +132,9 @@ class ODRDVehicle extends Vehicle { json['vehicleState'] = vehicleState!.toJsonString(); } if (supportedTripTypes != null) { - json['supportedTripTypes'] = - supportedTripTypes! - .map((ODRDTripType e) => e.toJsonString()) - .toList(); + json['supportedTripTypes'] = supportedTripTypes! + .map((ODRDTripType e) => e.toJsonString()) + .toList(); } if (backToBackEnabled != null) { json['backToBackEnabled'] = backToBackEnabled; @@ -475,8 +468,9 @@ class ODRDCreateTrip { }; if (intermediateDestinations != null) { - json['intermediateDestinations'] = - intermediateDestinations!.map((LatLng l) => l.toJson()).toList(); + json['intermediateDestinations'] = intermediateDestinations! + .map((LatLng l) => l.toJson()) + .toList(); } return json; @@ -505,12 +499,9 @@ class ODRDTrip { tripStatus: ODRDTripStatusJsonConversion.fromJsonString( json['tripStatus'] as String, ), - waypoints: - (json['waypoints'] as List) - .map( - (dynamic e) => ODRDWaypoint.fromJson(e as Map), - ) - .toList(), + waypoints: (json['waypoints'] as List) + .map((dynamic e) => ODRDWaypoint.fromJson(e as Map)) + .toList(), ); } diff --git a/example/lib/main.dart b/example/lib/main.dart index 80a08cd..7bf9e2f 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -148,8 +148,8 @@ class _DriverDemoState extends State with WidgetsBindingObserver { /// Android: Fine and Coarse Location /// iOS: CoreLocation (Always and WhenInUse), Notification Future _requestPermissions() async { - final PermissionStatus locationPermission = - await Permission.location.request(); + final PermissionStatus locationPermission = await Permission.location + .request(); PermissionStatus notificationPermission = PermissionStatus.denied; if (Platform.isIOS) { @@ -171,10 +171,9 @@ class _DriverDemoState extends State with WidgetsBindingObserver { @override Widget build(BuildContext context) { - String buildPermissionsStatus() => - (Platform.isIOS - ? 'Location ${_locationPermitted ? 'granted' : 'denied'} • Notifications ${_notificationsPermitted ? 'granted' : 'denied'}' - : 'Location ${_locationPermitted ? 'granted' : 'denied'} '); + String buildPermissionsStatus() => (Platform.isIOS + ? 'Location ${_locationPermitted ? 'granted' : 'denied'} • Notifications ${_notificationsPermitted ? 'granted' : 'denied'}' + : 'Location ${_locationPermitted ? 'granted' : 'denied'} '); return Scaffold( appBar: AppBar(title: const Text('Google Maps Driver examples')), diff --git a/example/lib/pages/lmfs_driver.dart b/example/lib/pages/lmfs_driver.dart index 98ca319..77bcd1b 100644 --- a/example/lib/pages/lmfs_driver.dart +++ b/example/lib/pages/lmfs_driver.dart @@ -182,20 +182,19 @@ class _DriverPageState extends ExamplePageState return _tokenResponse!.token; }, - onStatusUpdate: - Platform.isAndroid - ? ( - DriverStatusLevel level, - DriverStatusCode code, - String message, - DriverException? exception, - ) { - debugPrint( - // ignore: unnecessary_brace_in_string_interps - 'Driver status changed: $level - $code - $message, e: ${exception?.code} ${exception?.message}', - ); - } - : null, + onStatusUpdate: Platform.isAndroid + ? ( + DriverStatusLevel level, + DriverStatusCode code, + String message, + DriverException? exception, + ) { + debugPrint( + // ignore: unnecessary_brace_in_string_interps + 'Driver status changed: $level - $code - $message, e: ${exception?.code} ${exception?.message}', + ); + } + : null, ); if (Platform.isIOS) { @@ -206,10 +205,7 @@ class _DriverPageState extends ExamplePageState 'Vehicle update succeeded - location (${vehicleUpdate.location?.latitude.toStringAsFixed(3) ?? '-'}, ${vehicleUpdate.location?.longitude.toStringAsFixed(3) ?? '-'})', ); }, - onDidFail: ( - VehicleUpdate vehicleUpdate, - DriverException exception, - ) { + onDidFail: (VehicleUpdate vehicleUpdate, DriverException exception) { debugPrint( 'Vehicle updated failed - location (${vehicleUpdate.location?.latitude.toStringAsFixed(3) ?? '-'}, ${vehicleUpdate.location?.longitude.toStringAsFixed(3) ?? '-'})', ); @@ -219,8 +215,8 @@ class _DriverPageState extends ExamplePageState ); } - _locationReportingInterval = - await DeliveryDriver.vehicleReporter.getLocationReportingInterval(); + _locationReportingInterval = await DeliveryDriver.vehicleReporter + .getLocationReportingInterval(); await DeliveryDriver.vehicleReporter.setLocationTrackingEnabled( _locationTrackingEnabled, ); @@ -258,8 +254,8 @@ class _DriverPageState extends ExamplePageState Future _updateVehicleStopsFromVehicleReporter() async { final VehicleStopState prevState = _nextStop?.vehicleStopState ?? VehicleStopState.newStop; - final List stops = - await DeliveryDriver.vehicleReporter.getRemainingVehicleStops(); + final List stops = await DeliveryDriver.vehicleReporter + .getRemainingVehicleStops(); _forceUpdateLocalStopState(prevState, stops); _updateStops(stops); } @@ -363,8 +359,8 @@ class _DriverPageState extends ExamplePageState Future _enrouteToNextStop() async { if (_stopUpdateMethod == _StopUpdateMethod.driverApi) { try { - final List stops = - await DeliveryDriver.vehicleReporter.enrouteToNextStop(); + final List stops = await DeliveryDriver.vehicleReporter + .enrouteToNextStop(); _forceUpdateLocalStopState(VehicleStopState.enroute, stops); _updateStops(stops); } on DriverException catch (e) { @@ -384,8 +380,8 @@ class _DriverPageState extends ExamplePageState Future _arrivedAtStop() async { if (_stopUpdateMethod == _StopUpdateMethod.driverApi) { try { - final List stops = - await DeliveryDriver.vehicleReporter.arrivedAtStop(); + final List stops = await DeliveryDriver.vehicleReporter + .arrivedAtStop(); _forceUpdateLocalStopState(VehicleStopState.arrived, stops); _updateStops(stops); } on DriverException catch (e) { @@ -405,8 +401,8 @@ class _DriverPageState extends ExamplePageState Future _completedStop() async { if (_stopUpdateMethod == _StopUpdateMethod.driverApi) { try { - final List stops = - await DeliveryDriver.vehicleReporter.completedStop(); + final List stops = await DeliveryDriver.vehicleReporter + .completedStop(); _forceUpdateLocalStopState(VehicleStopState.newStop, stops); _updateStops(stops); } on DriverException catch (e) { @@ -470,8 +466,8 @@ class _DriverPageState extends ExamplePageState } Future _showDeliveryVehicle() async { - final DeliveryVehicle vehicle = - await DeliveryDriver.vehicleReporter.getDeliveryVehicle(); + final DeliveryVehicle vehicle = await DeliveryDriver.vehicleReporter + .getDeliveryVehicle(); showOverlaySnackBar(''' Delivery vehicle Id: ${vehicle.id} @@ -546,12 +542,9 @@ Stops: ${vehicle.stops.length}'''); ), if (!_driverInitialized && _backendInitialized) ElevatedButton( - onPressed: - () => Clipboard.setData( - ClipboardData( - text: _manifest.vehicle.vehicleId, - ), - ), + onPressed: () => Clipboard.setData( + ClipboardData(text: _manifest.vehicle.vehicleId), + ), child: const Text('Copy vehicle ID'), ), if (_driverInitialized && @@ -591,8 +584,9 @@ Stops: ${vehicle.stops.length}'''); ), getOverlayOptionsButton( context, - onPressed: - _backendInitialized ? () => toggleOverlay() : null, + onPressed: _backendInitialized + ? () => toggleOverlay() + : null, ), ], ), @@ -616,8 +610,9 @@ Stops: ${vehicle.stops.length}'''); spacing: 10, children: [ ElevatedButton( - onPressed: - _driverInitialized ? _disposeDriver : _initDriver, + onPressed: _driverInitialized + ? _disposeDriver + : _initDriver, child: Text( _driverInitialized ? 'Dispose driver' @@ -625,19 +620,17 @@ Stops: ${vehicle.stops.length}'''); ), ), ElevatedButton( - onPressed: - () => Clipboard.setData( - ClipboardData(text: _manifest.vehicle.vehicleId), - ), + onPressed: () => Clipboard.setData( + ClipboardData(text: _manifest.vehicle.vehicleId), + ), child: const Text('Copy vehicle ID'), ), ElevatedButton( - onPressed: - _driverInitialized - ? _navigationRunning - ? _stopNavigation - : _startNavigation - : null, + onPressed: _driverInitialized + ? _navigationRunning + ? _stopNavigation + : _startNavigation + : null, child: Text( _navigationRunning ? 'Stop navigation' @@ -700,10 +693,9 @@ Stops: ${vehicle.stops.length}'''); child: const Text('Arrived at stop'), ), ElevatedButton( - onPressed: - _driverInitialized && _nextStop != null - ? _completedStop - : null, + onPressed: _driverInitialized && _nextStop != null + ? _completedStop + : null, child: const Text('Completed stop'), ), if (_stopUpdateMethod == _StopUpdateMethod.driverApi) @@ -753,24 +745,23 @@ Stops: ${vehicle.stops.length}'''); max: 60, value: _locationReportingInterval?.inSeconds.toDouble() ?? 5, fractionDigits: 0, - onChanged: - _locationTrackingEnabled - ? (double newValue) async { - _locationReportingInterval = Duration( - seconds: newValue.toInt(), - ); - if (_driverInitialized) { - await DeliveryDriver.vehicleReporter - .setLocationReportingInterval( - _locationReportingInterval!, - ); - setState(() { - _locationReportingInterval = - _locationReportingInterval; - }); - } + onChanged: _locationTrackingEnabled + ? (double newValue) async { + _locationReportingInterval = Duration( + seconds: newValue.toInt(), + ); + if (_driverInitialized) { + await DeliveryDriver.vehicleReporter + .setLocationReportingInterval( + _locationReportingInterval!, + ); + setState(() { + _locationReportingInterval = + _locationReportingInterval; + }); } - : null, + } + : null, ), ], ), @@ -794,8 +785,9 @@ Stops: ${vehicle.stops.length}'''); }, ), ElevatedButton( - onPressed: - _driverInitialized ? _setSupplementalLocation : null, + onPressed: _driverInitialized + ? _setSupplementalLocation + : null, child: const Text('Set supplemental location'), ), ], diff --git a/example/lib/pages/odrd_driver.dart b/example/lib/pages/odrd_driver.dart index 7bc0a7e..d6c516e 100644 --- a/example/lib/pages/odrd_driver.dart +++ b/example/lib/pages/odrd_driver.dart @@ -232,18 +232,17 @@ class _DriverPageState extends ExamplePageState debugPrint('ODRD backend Trip ID: ${_trip!.tripId}'); if (_vehicle?.waypoints != null) { - _waypoints = - _vehicle!.waypoints! - .asMap() - .entries - .map( - (MapEntry waypointEntry) => - NavigationWaypoint.withLatLngTarget( - target: waypointEntry.value.location, - title: 'Waypoint ${waypointEntry.key + 1}', - ), - ) - .toList(); + _waypoints = _vehicle!.waypoints! + .asMap() + .entries + .map( + (MapEntry waypointEntry) => + NavigationWaypoint.withLatLngTarget( + target: waypointEntry.value.location, + title: 'Waypoint ${waypointEntry.key + 1}', + ), + ) + .toList(); } await _initNavigation(); _pollVehicleUpdates(); @@ -280,19 +279,18 @@ class _DriverPageState extends ExamplePageState return Future.value(_tokenResponse!.token); }, - onStatusUpdate: - Platform.isAndroid - ? ( - DriverStatusLevel level, - DriverStatusCode code, - String message, - DriverException? exception, - ) { - debugPrint( - 'Driver status changed: $level - $code - $message, e: ${exception?.code} ${exception?.message}', - ); - } - : null, + onStatusUpdate: Platform.isAndroid + ? ( + DriverStatusLevel level, + DriverStatusCode code, + String message, + DriverException? exception, + ) { + debugPrint( + 'Driver status changed: $level - $code - $message, e: ${exception?.code} ${exception?.message}', + ); + } + : null, ); if (Platform.isIOS) { @@ -303,10 +301,7 @@ class _DriverPageState extends ExamplePageState 'Vehicle update succeeded - location (${vehicleUpdate.location?.latitude.toStringAsFixed(3) ?? '-'}, ${vehicleUpdate.location?.longitude.toStringAsFixed(3) ?? '-'}) and state: ${vehicleUpdate.vehicleState == VehicleState.online ? 'online' : 'offline'}', ); }, - onDidFail: ( - VehicleUpdate vehicleUpdate, - DriverException exception, - ) { + onDidFail: (VehicleUpdate vehicleUpdate, DriverException exception) { debugPrint( 'Vehicle updated failed - location (${vehicleUpdate.location?.latitude.toStringAsFixed(3) ?? '-'}, ${vehicleUpdate.location?.longitude.toStringAsFixed(3) ?? '-'}) state: ${vehicleUpdate.vehicleState == VehicleState.online ? 'online' : 'offline'}', ); @@ -320,9 +315,9 @@ class _DriverPageState extends ExamplePageState await RidesharingDriver.vehicleReporter.setLocationReportingInterval( const Duration(seconds: 5), ); - _locationReportingIntervalMillis = - await RidesharingDriver.vehicleReporter - .getLocationReportingInterval(); + _locationReportingIntervalMillis = await RidesharingDriver + .vehicleReporter + .getLocationReportingInterval(); if (!_locationTrackingEnabled) { await _setLocationTrackingEnabled(true); } @@ -409,10 +404,9 @@ class _DriverPageState extends ExamplePageState _lastKnownDriverLocation = vehicle.lastLocation; } - _vehicleState = - vehicle.vehicleState == ODRDVehicleState.online - ? VehicleState.online - : VehicleState.offline; + _vehicleState = vehicle.vehicleState == ODRDVehicleState.online + ? VehicleState.online + : VehicleState.offline; setState(() { _vehicleUpdated = true; @@ -657,14 +651,12 @@ class _DriverPageState extends ExamplePageState @override Widget build(BuildContext context) { - final String tripState = - _trip?.vehicleId != null - ? 'Trip state: ${_getTripStatusText(_trip?.tripStatus)}' - : 'No trip'; - final String vehicleState = - _trip?.vehicleId != null - ? 'Assigned vehicle ID: ${_trip?.vehicleId}' - : 'No assigned vehicle'; + final String tripState = _trip?.vehicleId != null + ? 'Trip state: ${_getTripStatusText(_trip?.tripStatus)}' + : 'No trip'; + final String vehicleState = _trip?.vehicleId != null + ? 'Assigned vehicle ID: ${_trip?.vehicleId}' + : 'No assigned vehicle'; return buildPage( context, Stack( @@ -710,16 +702,16 @@ class _DriverPageState extends ExamplePageState ), if (_driverInitialized && !_locationTrackingEnabled) ElevatedButton( - onPressed: - () => _setLocationTrackingEnabled(true), + onPressed: () => + _setLocationTrackingEnabled(true), child: const Text('Enable location tracking'), ), if (_driverInitialized && _locationTrackingEnabled && _vehicleState == VehicleState.offline) ElevatedButton( - onPressed: - () => _setVehicleState(VehicleState.online), + onPressed: () => + _setVehicleState(VehicleState.online), child: const Text('Set vehicle online'), ), if (_driverInitialized && @@ -746,8 +738,9 @@ class _DriverPageState extends ExamplePageState ), getOverlayOptionsButton( context, - onPressed: - _backendInitialized ? () => toggleOverlay() : null, + onPressed: _backendInitialized + ? () => toggleOverlay() + : null, ), ], ), @@ -792,17 +785,17 @@ class _DriverPageState extends ExamplePageState SwitchListTile( title: const Text('Vehicle online'), value: _vehicleState == VehicleState.online, - onChanged: - _locationTrackingEnabled - ? (bool value) async { - final VehicleState newState = - value ? VehicleState.online : VehicleState.offline; - await _setVehicleState(newState); - setState(() { - _vehicleState = newState; - }); - } - : null, + onChanged: _locationTrackingEnabled + ? (bool value) async { + final VehicleState newState = value + ? VehicleState.online + : VehicleState.offline; + await _setVehicleState(newState); + setState(() { + _vehicleState = newState; + }); + } + : null, ), SwitchListTile( title: const Text('Show fleet engine location marker'), @@ -812,8 +805,9 @@ class _DriverPageState extends ExamplePageState }, ), ElevatedButton( - onPressed: - _driverInitialized ? _disposeDriver : _initializeDriver, + onPressed: _driverInitialized + ? _disposeDriver + : _initializeDriver, child: Text( _driverInitialized ? 'Dispose driver' : 'Initialize driver', ), @@ -895,15 +889,13 @@ class _DriverPageState extends ExamplePageState final Marker updatedMarker = _fleetEngineLocationMarker!.copyWith( options: options, ); - _fleetEngineLocationMarker = - (await viewController.updateMarkers([ - updatedMarker, - ])).firstOrNull; + _fleetEngineLocationMarker = (await viewController.updateMarkers( + [updatedMarker], + )).firstOrNull; } else { - _fleetEngineLocationMarker = - (await viewController.addMarkers([ - options, - ])).firstOrNull; + _fleetEngineLocationMarker = (await viewController.addMarkers( + [options], + )).firstOrNull; } } else { if (_fleetEngineLocationMarker != null) { diff --git a/example/lib/utils/overlay_options.dart b/example/lib/utils/overlay_options.dart index 2e1ca76..210e8aa 100644 --- a/example/lib/utils/overlay_options.dart +++ b/example/lib/utils/overlay_options.dart @@ -35,8 +35,9 @@ Widget getOverlayOptionsButton( ButtonStyle? style, }) => SafeArea( child: Align( - alignment: - Platform.isAndroid ? Alignment.bottomCenter : Alignment.bottomRight, + alignment: Platform.isAndroid + ? Alignment.bottomCenter + : Alignment.bottomRight, child: Padding( padding: const EdgeInsets.all(10), child: getOptionsButton(context, onPressed: onPressed, style: style), diff --git a/example/lib/widgets/dropdown_button.dart b/example/lib/widgets/dropdown_button.dart index aceaec4..5b62c65 100644 --- a/example/lib/widgets/dropdown_button.dart +++ b/example/lib/widgets/dropdown_button.dart @@ -36,10 +36,9 @@ class ExampleDropdownButton extends StatelessWidget { title: Text(title), trailing: DropdownButton( value: value, - items: - items.map>((T value) { - return DropdownMenuItem(value: value, child: Text(value.name)); - }).toList(), + items: items.map>((T value) { + return DropdownMenuItem(value: value, child: Text(value.name)); + }).toList(), onChanged: onChanged, ), ); diff --git a/example/lib/widgets/page.dart b/example/lib/widgets/page.dart index 9664e60..eafd345 100644 --- a/example/lib/widgets/page.dart +++ b/example/lib/widgets/page.dart @@ -95,7 +95,10 @@ abstract class ExamplePageState extends State Widget buildPage(BuildContext context, Widget child) { return Stack( children: [ - Scaffold(appBar: AppBar(title: Text(widget.title)), body: child), + Scaffold( + appBar: AppBar(title: Text(widget.title)), + body: child, + ), if (_isOverlayVisible) _buildOverlay(), ], ); @@ -109,12 +112,9 @@ abstract class ExamplePageState extends State onTap: hideOverlay, child: AnimatedBuilder( animation: _controller, - builder: - (BuildContext context, Widget? child) => Container( - color: Colors.black.withValues( - alpha: _controller.value * 0.5, - ), - ), + builder: (BuildContext context, Widget? child) => Container( + color: Colors.black.withValues(alpha: _controller.value * 0.5), + ), ), ), // Overlay content @@ -187,26 +187,25 @@ abstract class ExamplePageState extends State }) { final OverlayState overlay = Overlay.of(context); final OverlayEntry overlayEntry = OverlayEntry( - builder: - (BuildContext context) => Align( - alignment: alignment, - child: SizedBox( - width: double.infinity, - child: Material( - elevation: 10.0, - child: Container( - padding: const EdgeInsets.all(16), - color: Theme.of(context).snackBarTheme.backgroundColor, - child: SafeArea( - child: Text( - message, - style: Theme.of(context).snackBarTheme.contentTextStyle, - ), - ), + builder: (BuildContext context) => Align( + alignment: alignment, + child: SizedBox( + width: double.infinity, + child: Material( + elevation: 10.0, + child: Container( + padding: const EdgeInsets.all(16), + color: Theme.of(context).snackBarTheme.backgroundColor, + child: SafeArea( + child: Text( + message, + style: Theme.of(context).snackBarTheme.contentTextStyle, ), ), ), ), + ), + ), ); overlay.insert(overlayEntry); diff --git a/example/lib/widgets/slider_editor.dart b/example/lib/widgets/slider_editor.dart index c897b14..b260d91 100644 --- a/example/lib/widgets/slider_editor.dart +++ b/example/lib/widgets/slider_editor.dart @@ -49,12 +49,11 @@ class ExampleSlider extends StatelessWidget { ), Slider( value: value, - onChanged: - onChanged == null - ? null - : (double newValue) { - onChanged!(newValue); - }, + onChanged: onChanged == null + ? null + : (double newValue) { + onChanged!(newValue); + }, min: min, max: max, ), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 4cc5b7f..3b27ab5 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -25,6 +25,7 @@ dependencies: sdk: flutter google_driver_flutter: path: ../ + google_navigation_flutter: ^0.8.0 http: ^1.1.2 permission_handler: ^11.3.1 diff --git a/ios/Classes/AccessTokenProvider.swift b/ios/Classes/AccessTokenProvider.swift index 1722146..ff302b4 100644 --- a/ios/Classes/AccessTokenProvider.swift +++ b/ios/Classes/AccessTokenProvider.swift @@ -39,9 +39,9 @@ class AccessTokenProvider: NSObject, GMTDAuthorization, ObservableObject { vehicleId: authorizationContext?.vehicleID ?? nil ) { result in switch result { - case let .success(data): + case .success(let data): completion(data, nil) - case let .failure(error): + case .failure(let error): let nsError = NSError( domain: "com.google.mapsplatform.transportation.driver.vehiclereporter.ErrorDomain", code: 0, diff --git a/lib/src/google_driver_flutter.dart b/lib/src/google_driver_flutter.dart index 7899b51..dfbbf30 100644 --- a/lib/src/google_driver_flutter.dart +++ b/lib/src/google_driver_flutter.dart @@ -810,9 +810,9 @@ class _DriverStatusListenerApiImpl implements DriverStatusListenerApi { message, errorCode != null ? DriverException( - message: errorMessage ?? 'Unknown error.', - code: errorCode, - ) + message: errorMessage ?? 'Unknown error.', + code: errorCode, + ) : null, ); } diff --git a/lib/src/method_channel/convert/delivery_vehicle.dart b/lib/src/method_channel/convert/delivery_vehicle.dart index a293824..5850930 100644 --- a/lib/src/method_channel/convert/delivery_vehicle.dart +++ b/lib/src/method_channel/convert/delivery_vehicle.dart @@ -24,11 +24,10 @@ extension ConvertDeliveryVehicleDto on DeliveryVehicleDto { providerId: providerId, id: id, name: name, - stops: - stops - .whereType() - .map((VehicleStopDto e) => e.toVehicleStop()) - .toList(), + stops: stops + .whereType() + .map((VehicleStopDto e) => e.toVehicleStop()) + .toList(), ); } } diff --git a/lib/src/method_channel/convert/vehiclestop.dart b/lib/src/method_channel/convert/vehiclestop.dart index af37f6c..08e59b3 100644 --- a/lib/src/method_channel/convert/vehiclestop.dart +++ b/lib/src/method_channel/convert/vehiclestop.dart @@ -90,10 +90,9 @@ extension ConvertVehicleStopDto on VehicleStopDto { return VehicleStop( vehicleStopState: vehicleStopState.toVehicleStopState(), waypoint: waypoint?.toNavigationWaypoint(), - taskInfoList: - taskInfoList.nonNulls - .map((TaskInfoDto task) => task.toTaskInfo()) - .toList(), + taskInfoList: taskInfoList.nonNulls + .map((TaskInfoDto task) => task.toTaskInfo()) + .toList(), ); } } diff --git a/lib/src/method_channel/convert/vehicleupdate.dart b/lib/src/method_channel/convert/vehicleupdate.dart index 2a5d9bf..dd4c014 100644 --- a/lib/src/method_channel/convert/vehicleupdate.dart +++ b/lib/src/method_channel/convert/vehicleupdate.dart @@ -24,10 +24,9 @@ extension ConvertVehicleUpdateDto on VehicleUpdateDto { destinationWaypoint: destinationWaypoint?.toNavigationWaypoint(), location: location?.toLatLng(), remainingDistanceInMeters: remainingDistanceInMeters?.toInt(), - remainingTimeInSeconds: - remainingTimeInSeconds != null - ? Duration(seconds: remainingTimeInSeconds!.toInt()) - : null, + remainingTimeInSeconds: remainingTimeInSeconds != null + ? Duration(seconds: remainingTimeInSeconds!.toInt()) + : null, route: route?.map((LatLngDto? e) => e?.toLatLng()).toList(), vehicleState: vehicleState?.toVehicleState(), ); diff --git a/lib/src/method_channel/messages.g.dart b/lib/src/method_channel/messages.g.dart index dd8e4fa..cd69e8a 100644 --- a/lib/src/method_channel/messages.g.dart +++ b/lib/src/method_channel/messages.g.dart @@ -578,8 +578,9 @@ class CommonDriverApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -941,8 +942,9 @@ class DeliveryDriverApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1142,8 +1144,9 @@ class RidesharingDriverApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) : pigeonVar_binaryMessenger = binaryMessenger, - pigeonVar_messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; final BinaryMessenger? pigeonVar_binaryMessenger; static const MessageCodec pigeonChannelCodec = _PigeonCodec(); @@ -1188,8 +1191,9 @@ abstract class AuthTokenEventApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( @@ -1240,8 +1244,9 @@ abstract class VehicleReporterListenerApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( @@ -1345,8 +1350,9 @@ abstract class DriverStatusListenerApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( diff --git a/test/google_driver_flutter_test.dart b/test/google_driver_flutter_test.dart index cfaf9c7..ebd9938 100644 --- a/test/google_driver_flutter_test.dart +++ b/test/google_driver_flutter_test.dart @@ -96,8 +96,8 @@ void main() { when( mockedCommonDriverApi.getProviderId(any), ).thenAnswer((Invocation _) => providerIdIn); - final String providerIdOut = - await publicCommonDriverApi.getProviderId(); + final String providerIdOut = await publicCommonDriverApi + .getProviderId(); final VerificationResult result = verify( mockedCommonDriverApi.getProviderId(captureAny), ); @@ -122,8 +122,8 @@ void main() { when( mockedCommonDriverApi.getDriverSdkVersion(any), ).thenAnswer((Invocation _) => sdkVersionIn); - final String sdkVersionOut = - await publicCommonDriverApi.getDriverSdkVersion(); + final String sdkVersionOut = await publicCommonDriverApi + .getDriverSdkVersion(); final VerificationResult result = verify( mockedCommonDriverApi.getDriverSdkVersion(captureAny), ); @@ -181,8 +181,8 @@ void main() { when( mockedCommonDriverApi.getLocationReportingIntervalMillis(any), ).thenAnswer((Invocation _) => reportingIntervalIn); - final Duration reportingIntervalOut = - await vehicleReporter.getLocationReportingInterval(); + final Duration reportingIntervalOut = await vehicleReporter + .getLocationReportingInterval(); final VerificationResult result = verify( mockedCommonDriverApi.getLocationReportingIntervalMillis(captureAny), ); diff --git a/test/messages_test.g.dart b/test/messages_test.g.dart index 15a8d11..5990e58 100644 --- a/test/messages_test.g.dart +++ b/test/messages_test.g.dart @@ -150,8 +150,9 @@ abstract class TestCommonDriverApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( @@ -653,8 +654,9 @@ abstract class TestDeliveryDriverApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( @@ -733,8 +735,8 @@ abstract class TestDeliveryDriverApi { Object? message, ) async { try { - final List output = - await api.enrouteToNextStop(); + final List output = await api + .enrouteToNextStop(); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -765,8 +767,8 @@ abstract class TestDeliveryDriverApi { Object? message, ) async { try { - final List output = - await api.getRemainingVehicleStops(); + final List output = await api + .getRemainingVehicleStops(); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -841,8 +843,8 @@ abstract class TestDeliveryDriverApi { Object? message, ) async { try { - final DeliveryVehicleDto output = - await api.getDeliveryVehicle(); + final DeliveryVehicleDto output = await api + .getDeliveryVehicle(); return [output]; } on PlatformException catch (e) { return wrapResponse(error: e); @@ -872,8 +874,9 @@ abstract class TestRidesharingDriverApi { BinaryMessenger? binaryMessenger, String messageChannelSuffix = '', }) { - messageChannelSuffix = - messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; + messageChannelSuffix = messageChannelSuffix.isNotEmpty + ? '.$messageChannelSuffix' + : ''; { final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( From 2039f8b8d63c9e5dc1e933c54da83f4ce23aa917 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 17 Dec 2025 18:26:41 +0200 Subject: [PATCH 05/15] feat: add SPM support --- .gitignore | 2 + .../xcshareddata/swiftpm/Package.resolved | 9 +++ .../xcshareddata/swiftpm/Package.resolved | 32 +++++++++++ ios/Assets/.gitkeep | 0 ios/google_driver_flutter.podspec | 7 +-- ios/google_driver_flutter/Package.swift | 56 +++++++++++++++++++ .../AccessTokenProvider.swift | 0 .../google_driver_flutter}/Convert.swift | 0 .../GoogleMapsBaseDriver.swift | 0 .../GoogleMapsCommonApiHandler.swift | 0 .../GoogleMapsDeliveryDriver.swift | 0 .../GoogleMapsDriverPlugin.swift | 0 .../GoogleMapsRidesharingDriver.swift | 0 .../PrivacyInfo.xcprivacy | 0 .../VehicleReporterListener.swift | 0 .../google_driver_flutter}/messages.g.swift | 0 16 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved delete mode 100644 ios/Assets/.gitkeep create mode 100644 ios/google_driver_flutter/Package.swift rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/AccessTokenProvider.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/Convert.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/GoogleMapsBaseDriver.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/GoogleMapsCommonApiHandler.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/GoogleMapsDeliveryDriver.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/GoogleMapsDriverPlugin.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/GoogleMapsRidesharingDriver.swift (100%) rename ios/{Resources => google_driver_flutter/Sources/google_driver_flutter}/PrivacyInfo.xcprivacy (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/VehicleReporterListener.swift (100%) rename ios/{Classes => google_driver_flutter/Sources/google_driver_flutter}/messages.g.swift (100%) diff --git a/.gitignore b/.gitignore index 37cf9d1..cb84d7c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,9 @@ Pods/ **/Flutter/flutter_assets/ ServiceDefinitions.json xcuserdata/ +.swiftpm/ .last_build_id +.build/ # Android local.properties diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3e19e31..80885ca 100644 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,14 @@ { "pins" : [ + { + "identity" : "ios-driver-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-driver-sdk", + "state" : { + "revision" : "6fd7075eb831cec6c59e244f5f5a75267009872b", + "version" : "10.0.0" + } + }, { "identity" : "ios-maps-sdk", "kind" : "remoteSourceControl", diff --git a/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..80885ca --- /dev/null +++ b/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,32 @@ +{ + "pins" : [ + { + "identity" : "ios-driver-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-driver-sdk", + "state" : { + "revision" : "6fd7075eb831cec6c59e244f5f5a75267009872b", + "version" : "10.0.0" + } + }, + { + "identity" : "ios-maps-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-maps-sdk", + "state" : { + "revision" : "71e09fe4c751d59d7b1e524e998f786b429b1b14", + "version" : "10.6.0" + } + }, + { + "identity" : "ios-navigation-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/googlemaps/ios-navigation-sdk", + "state" : { + "revision" : "bcee02b433831d29d1ac12a62038fd009c333f7b", + "version" : "10.6.0" + } + } + ], + "version" : 2 +} diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ios/google_driver_flutter.podspec b/ios/google_driver_flutter.podspec index 84969c8..e1e1aa5 100644 --- a/ios/google_driver_flutter.podspec +++ b/ios/google_driver_flutter.podspec @@ -13,7 +13,7 @@ A Google Maps Driver Flutter plugin. s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'google_driver_flutter/Sources/google_driver_flutter/**/*.swift' s.dependency 'Flutter' s.dependency 'GoogleRidesharingDriver', '~> 10.0.0' s.dependency 'google_navigation_flutter' @@ -23,8 +23,5 @@ A Google Maps Driver Flutter plugin. # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' - s.xcconfig = { - 'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) /usr/lib/swift', - } - s.resource_bundles = {'google_driver_flutter_privacy_info' => ['Resources/PrivacyInfo.xcprivacy']} + s.resource_bundles = {'google_driver_flutter_privacy_info' => ['google_driver_flutter/Sources/google_driver_flutter/PrivacyInfo.xcprivacy']} end \ No newline at end of file diff --git a/ios/google_driver_flutter/Package.swift b/ios/google_driver_flutter/Package.swift new file mode 100644 index 0000000..ec6365d --- /dev/null +++ b/ios/google_driver_flutter/Package.swift @@ -0,0 +1,56 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import PackageDescription + +let package = Package( + name: "google_driver_flutter", + platforms: [ + .iOS("16.0") + ], + products: [ + .library(name: "google-driver-flutter", targets: ["google_driver_flutter"]) + ], + dependencies: [ + .package( + url: "https://github.com/googlemaps/ios-driver-sdk", + exact: "10.0.0" + ), + // .package( + // url: "https://github.com/googlemaps/flutter-navigation-sdk/tree/main/ios/google_navigation_flutter", + // exact: "0.8.0" + // ), + ], + targets: [ + .target( + name: "google_driver_flutter", + dependencies: [ + .product( + name: "GoogleRidesharingDriver", + package: "ios-driver-sdk" + ), + // .product( + // name: "google-navigation-flutter", + // package: "google_navigation_flutter" + // ), + ], + resources: [ + .process("PrivacyInfo.xcprivacy") + ] + ) + ] +) diff --git a/ios/Classes/AccessTokenProvider.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/AccessTokenProvider.swift similarity index 100% rename from ios/Classes/AccessTokenProvider.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/AccessTokenProvider.swift diff --git a/ios/Classes/Convert.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/Convert.swift similarity index 100% rename from ios/Classes/Convert.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/Convert.swift diff --git a/ios/Classes/GoogleMapsBaseDriver.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsBaseDriver.swift similarity index 100% rename from ios/Classes/GoogleMapsBaseDriver.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsBaseDriver.swift diff --git a/ios/Classes/GoogleMapsCommonApiHandler.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsCommonApiHandler.swift similarity index 100% rename from ios/Classes/GoogleMapsCommonApiHandler.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsCommonApiHandler.swift diff --git a/ios/Classes/GoogleMapsDeliveryDriver.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsDeliveryDriver.swift similarity index 100% rename from ios/Classes/GoogleMapsDeliveryDriver.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsDeliveryDriver.swift diff --git a/ios/Classes/GoogleMapsDriverPlugin.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsDriverPlugin.swift similarity index 100% rename from ios/Classes/GoogleMapsDriverPlugin.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsDriverPlugin.swift diff --git a/ios/Classes/GoogleMapsRidesharingDriver.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsRidesharingDriver.swift similarity index 100% rename from ios/Classes/GoogleMapsRidesharingDriver.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/GoogleMapsRidesharingDriver.swift diff --git a/ios/Resources/PrivacyInfo.xcprivacy b/ios/google_driver_flutter/Sources/google_driver_flutter/PrivacyInfo.xcprivacy similarity index 100% rename from ios/Resources/PrivacyInfo.xcprivacy rename to ios/google_driver_flutter/Sources/google_driver_flutter/PrivacyInfo.xcprivacy diff --git a/ios/Classes/VehicleReporterListener.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/VehicleReporterListener.swift similarity index 100% rename from ios/Classes/VehicleReporterListener.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/VehicleReporterListener.swift diff --git a/ios/Classes/messages.g.swift b/ios/google_driver_flutter/Sources/google_driver_flutter/messages.g.swift similarity index 100% rename from ios/Classes/messages.g.swift rename to ios/google_driver_flutter/Sources/google_driver_flutter/messages.g.swift From ab1fad161d4628d3560e9118fe6d07cb2a2a6215 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 18 Dec 2025 14:31:57 +0200 Subject: [PATCH 06/15] fix: android build --- .../com/google/maps/flutter/driver/Convert.kt | 4 ++-- .../flutter/driver/GoogleMapsDeliveryDriver.kt | 15 ++++++++++----- .../driver/GoogleMapsRidesharingDriver.kt | 15 ++++++++++----- example/android/app/build.gradle.kts | 17 ++++++++++++----- example/integration_test/shared.dart | 2 ++ example/pubspec.yaml | 2 ++ lib/src/google_driver_flutter.dart | 11 +++++++++++ 7 files changed, 49 insertions(+), 17 deletions(-) diff --git a/android/src/main/kotlin/com/google/maps/flutter/driver/Convert.kt b/android/src/main/kotlin/com/google/maps/flutter/driver/Convert.kt index 4903bf5..acb2fad 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/driver/Convert.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/driver/Convert.kt @@ -89,8 +89,8 @@ object Convert { */ private fun convertWaypointToDto(waypoint: Waypoint): NavigationWaypointDto { return NavigationWaypointDto( - waypoint.title, - convertLatLngToDto(waypoint.position), + waypoint.title ?: "", + waypoint.position?.let { convertLatLngToDto(it) }, waypoint.placeId, waypoint.preferSameSideOfRoad, waypoint.preferredHeading.takeIf { it != -1 }?.toLong(), diff --git a/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsDeliveryDriver.kt b/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsDeliveryDriver.kt index 3620246..51d7df9 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsDeliveryDriver.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsDeliveryDriver.kt @@ -28,7 +28,7 @@ import com.google.common.collect.ImmutableList import com.google.common.util.concurrent.FutureCallback import com.google.common.util.concurrent.Futures import com.google.common.util.concurrent.MoreExecutors -import com.google.maps.flutter.navigation.GoogleMapsNavigationSessionManager +import com.google.maps.flutter.navigation.GoogleMapsNavigatorHolder import io.flutter.plugin.common.BinaryMessenger class GoogleMapsDeliveryDriver(private val messenger: BinaryMessenger) : @@ -46,7 +46,7 @@ class GoogleMapsDeliveryDriver(private val messenger: BinaryMessenger) : abnormalTerminationReportingEnabled: Boolean, ) { val navigator: Navigator = - GoogleMapsNavigationSessionManager.getInstance().getNavigatorWithoutError() + GoogleMapsNavigatorHolder.getNavigator() ?: throw FlutterError( "sessionNotInitialized", "Cannot access navigation functionality before the navigation session has been initialized.", @@ -54,6 +54,13 @@ class GoogleMapsDeliveryDriver(private val messenger: BinaryMessenger) : _statusListener = GoogleMapsDriverStatusListener(messenger, getActivity()) + val roadSnappedLocationProvider = + NavigationApi.getRoadSnappedLocationProvider(getActivity().application) + ?: throw FlutterError( + "roadSnappedLocationProviderUnavailable", + "Failed to obtain RoadSnappedLocationProvider. Ensure navigation is properly initialized.", + ) + val driverContext: DriverContext = DriverContext.builder(getActivity().application) .setProviderId(providerId) @@ -61,9 +68,7 @@ class GoogleMapsDeliveryDriver(private val messenger: BinaryMessenger) : .setNavigator(navigator) .setAuthTokenFactory(getAuthTokenFactory()) .setDriverStatusListener(_statusListener) - .setRoadSnappedLocationProvider( - NavigationApi.getRoadSnappedLocationProvider(getActivity().application) - ) + .setRoadSnappedLocationProvider(roadSnappedLocationProvider) .build() _deliveryDriverApi = NativeDeliveryDriverApi.createInstance(driverContext) diff --git a/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsRidesharingDriver.kt b/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsRidesharingDriver.kt index 199fd47..bd88fbe 100644 --- a/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsRidesharingDriver.kt +++ b/android/src/main/kotlin/com/google/maps/flutter/driver/GoogleMapsRidesharingDriver.kt @@ -21,7 +21,7 @@ import com.google.android.libraries.mapsplatform.transportation.driver.api.rides import com.google.android.libraries.mapsplatform.transportation.driver.api.ridesharing.vehiclereporter.RidesharingVehicleReporter import com.google.android.libraries.navigation.NavigationApi import com.google.android.libraries.navigation.Navigator -import com.google.maps.flutter.navigation.GoogleMapsNavigationSessionManager +import com.google.maps.flutter.navigation.GoogleMapsNavigatorHolder import io.flutter.plugin.common.BinaryMessenger class GoogleMapsRidesharingDriver(private val messenger: BinaryMessenger) : @@ -39,13 +39,20 @@ class GoogleMapsRidesharingDriver(private val messenger: BinaryMessenger) : abnormalTerminationReportingEnabled: Boolean, ) { val navigator: Navigator = - GoogleMapsNavigationSessionManager.getInstance().getNavigatorWithoutError() + GoogleMapsNavigatorHolder.getNavigator() ?: throw FlutterError( "sessionNotInitialized", "Cannot access navigation functionality before the navigation session has been initialized.", ) _statusListener = GoogleMapsDriverStatusListener(messenger, getActivity()) + val roadSnappedLocationProvider = + NavigationApi.getRoadSnappedLocationProvider(getActivity().application) + ?: throw FlutterError( + "roadSnappedLocationProviderUnavailable", + "Failed to obtain RoadSnappedLocationProvider. Ensure navigation is properly initialized.", + ) + val driverContext: DriverContext = DriverContext.builder(getActivity().application) .setProviderId(providerId) @@ -53,9 +60,7 @@ class GoogleMapsRidesharingDriver(private val messenger: BinaryMessenger) : .setNavigator(navigator) .setAuthTokenFactory(getAuthTokenFactory()) .setDriverStatusListener(_statusListener) - .setRoadSnappedLocationProvider( - NavigationApi.getRoadSnappedLocationProvider(getActivity().application) - ) + .setRoadSnappedLocationProvider(roadSnappedLocationProvider) .build() _ridesharingDriverApi = NativeRidesharingDriverApi.createInstance(driverContext) diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts index ac42ff6..8f69685 100644 --- a/example/android/app/build.gradle.kts +++ b/example/android/app/build.gradle.kts @@ -39,9 +39,11 @@ fun findDartDefineValue(key: String): String? { android { namespace = "com.google.maps.flutter.driver_example" compileSdk = flutter.compileSdkVersion - ndkVersion = "27.0.12077973" + ndkVersion = "28.2.13676358" compileOptions { + // Flag to enable support for the new language APIs + isCoreLibraryDesugaringEnabled = true // Sets Java compatibility to Java 11 sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -51,12 +53,18 @@ android { jvmTarget = JavaVersion.VERSION_11.toString() } + // Set this to the languages you actually use, otherwise you'll include resource strings + // for all languages supported by the Navigation SDK. + androidResources { + localeFilters.add("en") + } + defaultConfig { // Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.google.maps.flutter.driver_example" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. - minSdk = 23 + minSdk = 26 targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName @@ -71,8 +79,6 @@ android { // test case and uncomment the following line to clear the package data before running tests. // testInstrumentationRunnerArguments["clearPackageData"] = "true" - resourceConfigurations.add("en") - // Extract MAPS_API_KEY from Dart defines or environment variables // and use it as manifest placeholder. val mapsApiKey = System.getenv("MAPS_API_KEY") ?: findDartDefineValue("MAPS_API_KEY") ?: "" @@ -104,6 +110,7 @@ flutter { } dependencies { + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4") androidTestUtil("androidx.test:orchestrator:1.5.1") } @@ -124,4 +131,4 @@ secrets { ignoreList.add("sdk.*") // Ignore all keys matching the regexp "flutter.*" ignoreList.add("flutter.*") -} \ No newline at end of file +} diff --git a/example/integration_test/shared.dart b/example/integration_test/shared.dart index 0d0e815..6701cf1 100644 --- a/example/integration_test/shared.dart +++ b/example/integration_test/shared.dart @@ -24,6 +24,7 @@ import 'dart:io'; // https://docs.flutter.dev/cookbook/testing/integration/introduction import 'package:flutter/material.dart'; +import 'package:meta/meta.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_driver_flutter/google_driver_flutter.dart'; // ignore: depend_on_referenced_packages @@ -139,6 +140,7 @@ Future cleanup() async { } /// Create a wrapper [patrol] for [patrolTest] with custom options. +@isTest void patrol( String description, Future Function(PatrolIntegrationTester) callback, { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 3b27ab5..e888167 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -27,6 +27,7 @@ dependencies: path: ../ google_navigation_flutter: ^0.8.0 http: ^1.1.2 + meta: ^1.17.0 permission_handler: ^11.3.1 dev_dependencies: @@ -43,6 +44,7 @@ flutter: uses-material-design: true patrol: app_name: Driver Example + test_directory: integration_test android: package_name: com.google.maps.flutter.driver_example ios: diff --git a/lib/src/google_driver_flutter.dart b/lib/src/google_driver_flutter.dart index dfbbf30..a58a47d 100644 --- a/lib/src/google_driver_flutter.dart +++ b/lib/src/google_driver_flutter.dart @@ -338,6 +338,10 @@ class TypedCommonDriverApi { throw const DriverInitializationException( DriverInitializationError.apiAlreadyInitialized, ); + case 'roadSnappedLocationProviderUnavailable': + throw const DriverInitializationException( + DriverInitializationError.roadSnappedLocationProviderUnavailable, + ); default: rethrow; } @@ -666,6 +670,13 @@ enum DriverInitializationError { /// To resolve this error, make sure to call [DeliveryDriver.dispose] or /// [RidesharingDriver.dispose] before initializing the driver instance again. apiAlreadyInitialized, + + /// Road snapped location provider is unavailable. + /// + /// This error is thrown when the road snapped location provider could not + /// be obtained from the Navigation SDK. This typically indicates that + /// navigator is not properly initialized or configured. + roadSnappedLocationProviderUnavailable, } /// Exception thrown by [DeliveryDriver.initialize]. From 06723f789166fc145d05845f05207a047b7e2249 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Thu, 18 Dec 2025 14:33:03 +0200 Subject: [PATCH 07/15] docs: improve compile/target sdk documentation --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 264f1ca..e13b3fa 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,10 @@ This repository contains a Flutter plugin that allows users to use the [Google M ## Requirements -| | Android | iOS | -| ------------------------------- | ------------- | --------- | -| **Minimum mobile OS supported** | API level 26+ | iOS 16.0+ | -| **Target SDK** | 36 | - | +| | Android | iOS | +| ------------------------------- | ------- | --------- | +| **Minimum mobile OS supported** | SDK 26+ | iOS 16.0+ | +| **Compile/Target SDK** | SDK 36+ | - | * A Flutter project * A Google Cloud project with the [Navigation SDK enabled](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project), the [Maps SDK for iOS enabled](https://developers.google.com/maps/documentation/navigation/ios-sdk/config) and the [Local Rides and Deliveries API enabled](https://console.developers.google.com/apis/library/fleetengine.googleapis.com) From d22ce0bde61af65409a0d26240672bc9585ed0e2 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Mon, 12 Jan 2026 14:10:36 +0200 Subject: [PATCH 08/15] feat: upgrade google_navigation_flutter pacakge to 0.8.1 --- example/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index e888167..bf650c4 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -25,7 +25,7 @@ dependencies: sdk: flutter google_driver_flutter: path: ../ - google_navigation_flutter: ^0.8.0 + google_navigation_flutter: ^0.8.1 http: ^1.1.2 meta: ^1.17.0 permission_handler: ^11.3.1 diff --git a/pubspec.yaml b/pubspec.yaml index 07a2f98..4dc486a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ environment: dependencies: flutter: sdk: flutter - google_navigation_flutter: ^0.8.0 + google_navigation_flutter: ^0.8.1 dev_dependencies: build_runner: ^2.4.6 From d66ce63a3ca5d9103960d24825fa9c95e86ae66b Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 10:55:31 +0300 Subject: [PATCH 09/15] docs: use desugar_jdk_libs_nio library in example and update readme --- example/README.md | 34 +++++++++++++++++++++------- example/android/app/build.gradle.kts | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/example/README.md b/example/README.md index 73ce9ae..dca3505 100644 --- a/example/README.md +++ b/example/README.md @@ -42,6 +42,24 @@ This key will be specifically used for the Android build, overriding the Dart de > [!NOTE] > `local.properties` file should always be listed in your .gitignore file to ensure it is not committed to your repository. +#### Android desugaring + +If `minSdk` is set to less than 34 (API 34), you need to configure desugaring for your Android app. +To enable desugaring, add the following configurations to `android/app/build.gradle` file: +```groovy +android { + ... + compileOptions { + coreLibraryDesugaringEnabled true + ... + } +} + +dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4' +} +``` + ### iOS specific API key For iOS, the app attempts to read the `MAPS_API_KEY` in this order (first match applies): @@ -99,14 +117,14 @@ If you want to run the example app with a specific API key, see the [Setting up ### Dart defines Supported dart define values and their default values: -| Dart define | Description | Default value | -| ----------- | ----------- | ------------- | -| `MAPS_API_KEY` | Google Maps API key | `null` | -| `PROJECT_ID` | Firebase project ID | `null` | -| `LMFS_ANDROID_HOST_URL` | Android sample backend services base URL for Delivery Driver (LMFS) | [http://10.0.2.2:8091](#) | -| `LMFS_IOS_HOST_URL` | iOS backend sample services base URL for Delivery Driver (LMFS) | [http://localhost:8091](#) | -| `ODRD_ANDROID_HOST_URL` | Android backend sample services base URL for Ridesharing Driver (ODRD) | [http://10.0.2.2:8092](#) | -| `ODRD_IOS_HOST_URL` | iOS backend sample services base URL for Ridesharing Driver (ODRD) | [http://localhost:8092](#) | +| Dart define | Description | Default value | +| ----------------------- | ---------------------------------------------------------------------- | -------------------------- | +| `MAPS_API_KEY` | Google Maps API key | `null` | +| `PROJECT_ID` | Firebase project ID | `null` | +| `LMFS_ANDROID_HOST_URL` | Android sample backend services base URL for Delivery Driver (LMFS) | [http://10.0.2.2:8091](#) | +| `LMFS_IOS_HOST_URL` | iOS backend sample services base URL for Delivery Driver (LMFS) | [http://localhost:8091](#) | +| `ODRD_ANDROID_HOST_URL` | Android backend sample services base URL for Ridesharing Driver (ODRD) | [http://10.0.2.2:8092](#) | +| `ODRD_IOS_HOST_URL` | iOS backend sample services base URL for Ridesharing Driver (ODRD) | [http://localhost:8092](#) | ### Running the example app on physical devices diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts index 8f69685..258b387 100644 --- a/example/android/app/build.gradle.kts +++ b/example/android/app/build.gradle.kts @@ -110,7 +110,7 @@ flutter { } dependencies { - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4") + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs_nio:2.0.4") androidTestUtil("androidx.test:orchestrator:1.5.1") } From ecfed08fa21c63013d611e75d5b7006ba7215f93 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 11:03:05 +0300 Subject: [PATCH 10/15] feat: upgrade navigation sdk to version 0.8.4 --- example/android/gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 2 +- example/pubspec.yaml | 3 ++- pubspec.yaml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index df97d72..ed4c299 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/example/android/settings.gradle b/example/android/settings.gradle index f6de083..015b8e2 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -32,7 +32,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.8.1' apply false + id "com.android.application" version '8.13.0' apply false id "org.jetbrains.kotlin.android" version "2.1.0" apply false id "com.google.android.libraries.mapsplatform.secrets-gradle-plugin" version "2.0.1" apply false } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index bf650c4..9c0691b 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -18,6 +18,7 @@ publish_to: "none" environment: sdk: ^3.8.0 + flutter: ">=3.32.0" dependencies: cupertino_icons: ^1.0.8 @@ -25,7 +26,7 @@ dependencies: sdk: flutter google_driver_flutter: path: ../ - google_navigation_flutter: ^0.8.1 + google_navigation_flutter: ^0.8.4 http: ^1.1.2 meta: ^1.17.0 permission_handler: ^11.3.1 diff --git a/pubspec.yaml b/pubspec.yaml index 4dc486a..c1cdb62 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ environment: dependencies: flutter: sdk: flutter - google_navigation_flutter: ^0.8.1 + google_navigation_flutter: ^0.8.4 dev_dependencies: build_runner: ^2.4.6 From cec107afac6857d6b6bdf35d9bf88e9d78ae0f70 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 11:31:21 +0300 Subject: [PATCH 11/15] docs: update docker images --- example/tools/backend/FleetEngineAuth/Dockerfile | 2 +- example/tools/backend/LMFS/Dockerfile | 2 +- example/tools/backend/ODRD/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/tools/backend/FleetEngineAuth/Dockerfile b/example/tools/backend/FleetEngineAuth/Dockerfile index 6831e32..9b1de2c 100644 --- a/example/tools/backend/FleetEngineAuth/Dockerfile +++ b/example/tools/backend/FleetEngineAuth/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Use an appropriate Java base image -FROM openjdk:11 +FROM eclipse-temurin:11-jdk-jammy # Install necessary tools RUN apt-get update && \ diff --git a/example/tools/backend/LMFS/Dockerfile b/example/tools/backend/LMFS/Dockerfile index cb0790a..6f7fcfa 100644 --- a/example/tools/backend/LMFS/Dockerfile +++ b/example/tools/backend/LMFS/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Use an appropriate Java base image -FROM openjdk:17-jdk-slim +FROM eclipse-temurin:17-jdk-jammy # Install git RUN apt-get update && \ diff --git a/example/tools/backend/ODRD/Dockerfile b/example/tools/backend/ODRD/Dockerfile index 416f0de..fced8bd 100644 --- a/example/tools/backend/ODRD/Dockerfile +++ b/example/tools/backend/ODRD/Dockerfile @@ -13,7 +13,7 @@ # limitations under the License. # Use an appropriate Java base image -FROM openjdk:17-jdk-slim +FROM eclipse-temurin:17-jdk-jammy # Install git RUN apt-get update && \ From 6502ba604d7dbbf79d15eb470641d88f2f52612a Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 12:02:49 +0300 Subject: [PATCH 12/15] feat: upgrade iOS Driver SDK version to 10.10.0 --- README.md | 1 + example/.gitignore | 3 ++ example/ios/Flutter/AppFrameworkInfo.plist | 2 -- .../xcshareddata/swiftpm/Package.resolved | 32 ------------------- .../xcshareddata/swiftpm/Package.resolved | 32 ------------------- ios/google_driver_flutter.podspec | 2 +- ios/google_driver_flutter/Package.swift | 2 +- 7 files changed, 6 insertions(+), 68 deletions(-) delete mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved delete mode 100644 example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/README.md b/README.md index e13b3fa..9699264 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ This repository contains a Flutter plugin that allows users to use the [Google M * A Google Maps API key from the project above * Project ID for the project above * If targeting Android, [Google Play Services](https://developers.google.com/android/guides/overview) installed and enabled +* If targeting iOS, Xcode 26 or later is required * [Attributions and licensing text](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project#include_the_required_attributions_in_your_app) added to your app diff --git a/example/.gitignore b/example/.gitignore index 6c31954..4f54684 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -44,3 +44,6 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + +#iOS +Package.resolved diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 1f6b98f..6fe4034 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -24,7 +24,5 @@ arm64 - MinimumOSVersion - 13.0 diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 80885ca..0000000 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,32 +0,0 @@ -{ - "pins" : [ - { - "identity" : "ios-driver-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/googlemaps/ios-driver-sdk", - "state" : { - "revision" : "6fd7075eb831cec6c59e244f5f5a75267009872b", - "version" : "10.0.0" - } - }, - { - "identity" : "ios-maps-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/googlemaps/ios-maps-sdk", - "state" : { - "revision" : "71e09fe4c751d59d7b1e524e998f786b429b1b14", - "version" : "10.6.0" - } - }, - { - "identity" : "ios-navigation-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/googlemaps/ios-navigation-sdk", - "state" : { - "revision" : "bcee02b433831d29d1ac12a62038fd009c333f7b", - "version" : "10.6.0" - } - } - ], - "version" : 2 -} diff --git a/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 80885ca..0000000 --- a/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,32 +0,0 @@ -{ - "pins" : [ - { - "identity" : "ios-driver-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/googlemaps/ios-driver-sdk", - "state" : { - "revision" : "6fd7075eb831cec6c59e244f5f5a75267009872b", - "version" : "10.0.0" - } - }, - { - "identity" : "ios-maps-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/googlemaps/ios-maps-sdk", - "state" : { - "revision" : "71e09fe4c751d59d7b1e524e998f786b429b1b14", - "version" : "10.6.0" - } - }, - { - "identity" : "ios-navigation-sdk", - "kind" : "remoteSourceControl", - "location" : "https://github.com/googlemaps/ios-navigation-sdk", - "state" : { - "revision" : "bcee02b433831d29d1ac12a62038fd009c333f7b", - "version" : "10.6.0" - } - } - ], - "version" : 2 -} diff --git a/ios/google_driver_flutter.podspec b/ios/google_driver_flutter.podspec index e1e1aa5..1829aab 100644 --- a/ios/google_driver_flutter.podspec +++ b/ios/google_driver_flutter.podspec @@ -15,7 +15,7 @@ A Google Maps Driver Flutter plugin. s.source = { :path => '.' } s.source_files = 'google_driver_flutter/Sources/google_driver_flutter/**/*.swift' s.dependency 'Flutter' - s.dependency 'GoogleRidesharingDriver', '~> 10.0.0' + s.dependency 'GoogleRidesharingDriver', '~> 10.10.0' s.dependency 'google_navigation_flutter' s.platform = :ios, '16.0' s.static_framework = true diff --git a/ios/google_driver_flutter/Package.swift b/ios/google_driver_flutter/Package.swift index ec6365d..969cab7 100644 --- a/ios/google_driver_flutter/Package.swift +++ b/ios/google_driver_flutter/Package.swift @@ -28,7 +28,7 @@ let package = Package( dependencies: [ .package( url: "https://github.com/googlemaps/ios-driver-sdk", - exact: "10.0.0" + exact: "10.10.0" ), // .package( // url: "https://github.com/googlemaps/flutter-navigation-sdk/tree/main/ios/google_navigation_flutter", From d43391d52b11ce43ea499165701fd245b039d051 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 15:02:02 +0300 Subject: [PATCH 13/15] chore: update github workflows actions and tools --- .github/workflows/analyze.yaml | 53 +++++---- .github/workflows/build.yaml | 106 +++++++++++------- .github/workflows/licence-check.yaml | 15 ++- .github/workflows/release-please.yml | 4 +- CONTRIBUTING.md | 4 +- .../{settings.gradle => settings.gradle.kts} | 24 ++-- example/ios/Runner.xcodeproj/project.pbxproj | 6 +- ios/google_driver_flutter/Package.swift | 4 +- melos.yaml | 14 ++- tools/test-ios.sh | 2 +- 10 files changed, 139 insertions(+), 93 deletions(-) rename example/android/{settings.gradle => settings.gradle.kts} (55%) diff --git a/.github/workflows/analyze.yaml b/.github/workflows/analyze.yaml index c66aad8..278a3a8 100644 --- a/.github/workflows/analyze.yaml +++ b/.github/workflows/analyze.yaml @@ -28,15 +28,18 @@ jobs: timeout-minutes: 45 runs-on: ubuntu-latest steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 with: - flutter-version: "3.32.x" + flutter-version: "3.38.x" channel: "stable" cache: true - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 with: - melos-version: "6.0.0" + melos-version: "6.3.2" - name: "Run Flutter Analyze" run: melos run flutter-analyze @@ -44,11 +47,24 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: actions/setup-java@v4 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup java + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" + cache: "gradle" + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 + with: + flutter-version: "3.38.x" + channel: "stable" + cache: true + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + with: + melos-version: "6.3.2" - name: Restore Cache uses: actions/cache/restore@v4 id: cache @@ -56,37 +72,28 @@ jobs: path: /home/linuxbrew/.linuxbrew key: ${{ runner.os }}-linuxbrew - uses: Homebrew/actions/setup-homebrew@master - - name: Install swift-format 600.0.0 - #if: steps.cache.outputs.cache-hit != 'true' + - name: Install swift-format 602.0.0 + if: steps.cache.outputs.cache-hit != 'true' run: | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 - curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/402e262f48947bad849ea7793752ff16b7038406/Formula/s/swift-format.rb - echo 'brew "swift-format.rb"' > Brewfile - brew bundle + brew install swift-format - name: Save Cache uses: actions/cache/save@v4 if: steps.cache.outputs.cache-hit != 'true' with: path: /home/linuxbrew/.linuxbrew key: ${{ runner.os }}-linuxbrew - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 - with: - flutter-version: "3.32.x" - channel: "stable" - cache: true - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 - with: - melos-version: "6.0.0" - - name: "Formatter version" + - name: Print swift-format version run: | eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" swift-format --version - - name: "Run format" + - name: Run format if: ${{ success() || failure() }} run: | + eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" melos run format - - name: "Validate formatting" + - name: Validate formatting if: ${{ success() || failure() }} run: | ./.github/workflows/scripts/validate-formatting.sh diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 99f3d3c..244012f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,81 +25,96 @@ concurrency: jobs: test-dart: + name: Run dart unit tests timeout-minutes: 45 runs-on: labels: ubuntu-latest steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: actions/setup-java@v4 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup java + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" cache: "gradle" - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 with: - flutter-version: "3.32.x" + flutter-version: "3.38.x" channel: "stable" cache: true - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 with: - melos-version: "6.0.0" + melos-version: "6.3.2" - name: "Run flutter test" run: melos run test:dart test-android: + name: Run Android native unit tests timeout-minutes: 45 runs-on: labels: ubuntu-latest steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: actions/setup-java@v4 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup java + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" cache: "gradle" - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 with: - flutter-version: "3.32.x" + flutter-version: "3.38.x" channel: "stable" cache: true - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 with: - melos-version: "6.0.0" + melos-version: "6.3.2" - name: "Run Android native unit tests" run: melos run test:android test-ios: + name: Run iOS native unit tests timeout-minutes: 45 runs-on: labels: macos-latest-xlarge - strategy: - matrix: - working_directory: ["example"] + env: + working_directory: "example" steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: actions/cache@v4 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 + with: + flutter-version: "3.38.x" + channel: "stable" + cache: true + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + with: + melos-version: "6.3.2" + - name: Cache podfiles + uses: actions/cache@v4 with: path: "**/Pods" key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }} restore-keys: | ${{ runner.os }}-pods- - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 - with: - flutter-version: "3.32.x" - channel: "stable" - cache: true - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 - with: - melos-version: "6.0.0" - - name: Select XCode 16.1 - run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer' + - name: Select XCode 26.3 + run: sudo xcode-select -s '/Applications/Xcode_26.3.0.app/Contents/Developer' - name: Generate necessary files with flutter build - working-directory: ${{ matrix.working_directory }} + working-directory: ${{ env.working_directory }} run: flutter build ios --config-only - name: "Run iOS native unit tests" - run: TEST_DEVICE='iPhone 16 Pro' TEST_OS='18.1' melos run test:ios + run: TEST_DEVICE='iPhone 16 Pro' TEST_OS='26.2' melos run test:ios build-android: + name: Build Android needs: [test-dart, test-android, test-ios] if: contains(github.base_ref, 'main') timeout-minutes: 45 @@ -108,24 +123,29 @@ jobs: env: MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }} steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: actions/setup-java@v4 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup java + uses: actions/setup-java@v4 with: distribution: "temurin" java-version: "17" cache: "gradle" - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 with: - flutter-version: "3.32.x" + flutter-version: "3.38.x" channel: "stable" cache: true - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 with: - melos-version: "6.0.0" + melos-version: "6.3.2" - name: "Run build for Android" run: melos run flutter-build-android build-ios: + name: Build iOS needs: [test-dart, test-android, test-ios] if: contains(github.base_ref, 'main') timeout-minutes: 90 @@ -133,17 +153,21 @@ jobs: env: MAPS_API_KEY: ${{ secrets.ACTIONS_API_KEY }} steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup flutter + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 with: - flutter-version: "3.32.x" + flutter-version: "3.38.x" channel: "stable" cache: true architecture: x64 - - uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 + - name: Setup melos + uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388 with: - melos-version: "6.0.0" - - uses: actions/cache@v4 + melos-version: "6.3.2" + - name: Cache podfiles + uses: actions/cache@v4 with: path: "**/Pods" key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }} diff --git a/.github/workflows/licence-check.yaml b/.github/workflows/licence-check.yaml index 1d3f49b..e61709a 100644 --- a/.github/workflows/licence-check.yaml +++ b/.github/workflows/licence-check.yaml @@ -28,17 +28,20 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Setup go + uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c with: go-version: "^1.13.1" # Go is used by addlicense command (addlicense is used in melos run # check-license-header) - - run: go install github.com/google/addlicense@latest + - name: Run addlicense + run: go install github.com/google/addlicense@latest - name: Install Flutter - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 with: - flutter-version: "3.32.x" + flutter-version: "3.38.x" channel: "stable" cache: true - name: Install Melos @@ -47,6 +50,6 @@ jobs: # Running `melos bootstrap` is not needed because we use Melos just # for the `check-license-header` script. run-bootstrap: false - melos-version: "6.0.0" + melos-version: "6.3.2" - name: Check license header run: melos run check-license-header diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index c8b1334..b8c1c78 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -31,6 +31,8 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: googleapis/release-please-action@d1a8f221d7723166f48a584aebba00ef3f6febec + - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 with: token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ceb0ed1..831e38a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,10 +7,10 @@ _See also: [Flutter's code of conduct](https://flutter.io/design-principles/#cod - **Operating System:** Linux, macOS, or Windows. - **Version Control:** [git](https://git-scm.com). - **Development Environment:** An IDE such as [Android Studio](https://developer.android.com/studio) or [Visual Studio Code](https://code.visualstudio.com/). -- **Code Formatting:** [`swift-format`](https://formulae.brew.sh/formula/swift-formatt). +- **Code Formatting:** [`swift-format`](https://formulae.brew.sh/formula/swift-format). ### 1.1. Installing swift-format -The CI is locked to swift-format 600.0.0 version which you can install with the command below: +The CI is locked to swift-format 602.0.0 which you can install with the command below: ```bash curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/402e262f48947bad849ea7793752ff16b7038406/Formula/s/swift-format.rb brew install swift-format.rb diff --git a/example/android/settings.gradle b/example/android/settings.gradle.kts similarity index 55% rename from example/android/settings.gradle rename to example/android/settings.gradle.kts index 015b8e2..2b72739 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle.kts @@ -13,13 +13,13 @@ // limitations under the License. pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") @@ -31,10 +31,10 @@ pluginManagement { } plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.13.0' apply false - id "org.jetbrains.kotlin.android" version "2.1.0" apply false - id "com.google.android.libraries.mapsplatform.secrets-gradle-plugin" version "2.0.1" apply false + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.13.0" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false } -include ":app" \ No newline at end of file +include(":app") diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 9c1f730..5100140 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -639,7 +639,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 5LUR69Y2U9; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -828,7 +828,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 5LUR69Y2U9; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -852,7 +852,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 5LUR69Y2U9; + DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; diff --git a/ios/google_driver_flutter/Package.swift b/ios/google_driver_flutter/Package.swift index 969cab7..21307f5 100644 --- a/ios/google_driver_flutter/Package.swift +++ b/ios/google_driver_flutter/Package.swift @@ -29,7 +29,7 @@ let package = Package( .package( url: "https://github.com/googlemaps/ios-driver-sdk", exact: "10.10.0" - ), + ) // .package( // url: "https://github.com/googlemaps/flutter-navigation-sdk/tree/main/ios/google_navigation_flutter", // exact: "0.8.0" @@ -42,7 +42,7 @@ let package = Package( .product( name: "GoogleRidesharingDriver", package: "ios-driver-sdk" - ), + ) // .product( // name: "google-navigation-flutter", // package: "google_navigation_flutter" diff --git a/melos.yaml b/melos.yaml index a95b08a..c7ddad8 100644 --- a/melos.yaml +++ b/melos.yaml @@ -169,10 +169,15 @@ scripts: run: | addlicense -f header_template.txt \ --ignore "**/Pods/**" \ - --ignore "**/.dart_tool/flutter_build/**" \ + --ignore "**/.dart_tool/**" \ --ignore "**/example/build/**" \ + --ignore "**/example/integration_test/test_bundle.dart" \ + --ignore "**/example/ios/Flutter/ephemeral/**" \ + --ignore "**/example/android/.idea/**" \ + --ignore "build/**" \ --ignore "**/GeneratedPluginRegistrant.*" \ --ignore "**/flutter_export_environment.sh" \ + --ignore "**/FlutterGeneratedPluginSwiftPackage/**" \ --ignore "**/pubspec_overrides.yaml" \ . description: Add a license header to all necessary files. @@ -184,10 +189,15 @@ scripts: addlicense -f header_template.txt \ --check \ --ignore "**/Pods/**" \ - --ignore "**/.dart_tool/flutter_build/**" \ + --ignore "**/.dart_tool/**" \ --ignore "**/example/build/**" \ + --ignore "**/example/integration_test/test_bundle.dart" \ + --ignore "**/example/ios/Flutter/ephemeral/**" \ + --ignore "**/example/android/.idea/**" \ + --ignore "build/**" \ --ignore "**/GeneratedPluginRegistrant.*" \ --ignore "**/flutter_export_environment.sh" \ + --ignore "**/FlutterGeneratedPluginSwiftPackage/**" \ --ignore "**/pubspec_overrides.yaml" \ . description: Add a license header to all necessary files. diff --git a/tools/test-ios.sh b/tools/test-ios.sh index dae5be4..3e2d955 100755 --- a/tools/test-ios.sh +++ b/tools/test-ios.sh @@ -15,7 +15,7 @@ set -e DEVICE_NAME=${TEST_DEVICE:-'iPhone 16 Pro'} # Default to 'iPhone 16 Pro' if no argument is provided -OS_VERSION=${TEST_OS:-'18.1'} # Default to 'iPhone 16 Pro' if no argument is provided +OS_VERSION=${TEST_OS:-'26.2'} # Default to 'iOS 26.2' if no argument is provided # Navigate to the ios directory and run xcodebuild with the provided device name cd ios && xcodebuild test \ From 390790017bfd221c3c66aa3f1fe44630bd0ed4f5 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 15:14:12 +0300 Subject: [PATCH 14/15] ci: fix ci issues --- .github/workflows/build.yaml | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 6 +++--- example/lib/pages/odrd_driver.dart | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 244012f..346a8d8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -109,7 +109,7 @@ jobs: run: sudo xcode-select -s '/Applications/Xcode_26.3.0.app/Contents/Developer' - name: Generate necessary files with flutter build working-directory: ${{ env.working_directory }} - run: flutter build ios --config-only + run: flutter build ios --config-only --simulator - name: "Run iOS native unit tests" run: TEST_DEVICE='iPhone 16 Pro' TEST_OS='26.2' melos run test:ios diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 5100140..9c1f730 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -639,7 +639,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 5LUR69Y2U9; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -828,7 +828,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 5LUR69Y2U9; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; @@ -852,7 +852,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 5LUR69Y2U9; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 16.0; diff --git a/example/lib/pages/odrd_driver.dart b/example/lib/pages/odrd_driver.dart index d6c516e..1d99ec8 100644 --- a/example/lib/pages/odrd_driver.dart +++ b/example/lib/pages/odrd_driver.dart @@ -450,6 +450,7 @@ class _DriverPageState extends ExamplePageState if (status.name.contains('enroute')) { if (_waypointIndex > 0 && _navigationRunning) { // After arriving to waypoint, continue to next destination. + // ignore: deprecated_member_use await GoogleMapsNavigator.continueToNextDestination(); } // Simulate the user location to the next waypoint. From a8aaa148db6104af372285859cf0745c041571c4 Mon Sep 17 00:00:00 2001 From: Joonas Kerttula Date: Wed, 1 Apr 2026 15:32:30 +0300 Subject: [PATCH 15/15] ci: fix build ios workflow --- .github/workflows/build.yaml | 4 ++-- melos.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 346a8d8..df0eaa4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -173,7 +173,7 @@ jobs: key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }} restore-keys: | ${{ runner.os }}-pods- - - name: Select XCode 16.1 - run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer' + - name: Select XCode 26.3 + run: sudo xcode-select -s '/Applications/Xcode_26.3.0.app/Contents/Developer' - name: "Run build for iOS" run: melos run flutter-build-ios diff --git a/melos.yaml b/melos.yaml index c7ddad8..a702d25 100644 --- a/melos.yaml +++ b/melos.yaml @@ -136,7 +136,7 @@ scripts: flutter-build-ios: run: | if [ -d "example" ]; then cd example; fi && \ - flutter pub get && flutter build ios --release --no-codesign + flutter pub get && flutter build ios --simulator exec: concurrency: 1 failFast: true