Skip to content

Commit

Permalink
chore: update patrol and minimum SDK version to Flutter 3.22.1/Dart 3…
Browse files Browse the repository at this point in the history
….4 (#92)

* upgrades the version to 0.2.3-beta
* chore: updated minimum supported SDK version to Flutter 3.22.1/Dart 3.4 and Patrol
  • Loading branch information
jokerttu authored Jun 4, 2024
1 parent 5ce5401 commit 8903912
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analyze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
Expand All @@ -51,7 +51,7 @@ jobs:
java-version: "17"
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
cache: "gradle"
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
Expand All @@ -59,7 +59,7 @@ jobs:
cache: "gradle"
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
Expand All @@ -85,7 +85,7 @@ jobs:
${{ runner.os }}-pods-
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
cache: "gradle"
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
Expand All @@ -134,7 +134,7 @@ jobs:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
architecture: x64
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
timeout-minutes: 45
strategy:
matrix:
patrol_cli_version: [2.5.0]
patrol_cli_version: [2.7.0]
working_directory: ["example"]
runs-on:
labels: ubuntu-latest-8core
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
key: avd
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- name: Install patrol_cli
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
timeout-minutes: 90
strategy:
matrix:
patrol_cli_version: [2.5.0]
patrol_cli_version: [2.7.0]
working_directory: ["example"]
runs-on:
labels: macos-13-large
Expand All @@ -119,7 +119,7 @@ jobs:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- uses: actions/cache@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/licence-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
with:
flutter-version: "3.19.x"
flutter-version: "3.22.x"
channel: "stable"
cache: true
- name: Install Melos
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.2.3-beta

This is the beta release of the Google Maps Navigation package for Flutter. It is an early look at the package and is intended for testing and feedback collection. The functionalities and APIs in this version are subject to change.

- Updates minimum supported SDK version to Flutter 3.22.1/Dart 3.4.
- Update patrol version to 3.7.2

## 0.2.2-beta

This is the beta release of the Google Maps Navigation package for Flutter. It is an early look at the package and is intended for testing and feedback collection. The functionalities and APIs in this version are subject to change.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Specify the device you want to run the tests on with the DEVICE env variable.
Integration tests are responsible for ensuring that the plugin works against the native Navigation SDK for both Android and iOS platforms. Patrol is used for the integration tests to simplify interactions with native elements. To use patrol, you first need to activate the patrol_cli.

```bash
flutter pub global activate patrol_cli 2.5.0
flutter pub global activate patrol_cli 2.7.0
```

To ensure that all necessary dependencies for patrol are properly set up, run the following command:
Expand Down
14 changes: 8 additions & 6 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<application
android:label="google_maps_navigation_example"
android:icon="@mipmap/ic_launcher">
Expand All @@ -36,12 +38,12 @@
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
8 changes: 4 additions & 4 deletions example/integration_test/t06_map_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ void main() {
debugPrint('My location button clicked event: currently $event');
}

/// The evot tested because there's no reliable way to trigger them currently.
/// The events are not tested because there's no reliable way to trigger them currently.
void onMyLocationClicked(MyLocationClickedEvent event) {
debugPrint('My location clicked event: currently $event');
}

/// The evot tested because there's no reliable way to trigger them currently.
/// The events are not tested because there's no reliable way to trigger them currently.
void onMapLongClicked(LatLng coordinates) {
debugPrint(
'Map clicked event lat: ${coordinates.latitude}, lng: ${coordinates.longitude}.');
Expand All @@ -118,14 +118,14 @@ void main() {
initializeNavigation: false,
onMapClicked: expectAsync1((LatLng msg) {
expectSync(msg, isA<LatLng>());
}, count: 1, max: 1),
}, max: 1),
onMapLongClicked: onMapLongClicked,
onMyLocationButtonClicked: onMyLocationButtonClicked,
onMyLocationClicked: onMyLocationClicked,
);

/// Test that the onMapClicked event comes in.
await $.native.tap(Selector(enabled: true));
await $.native.tapAt(const Offset(0.5, 0.5));

/// Test the default values match with what has been documented in the
/// API documentation in google_maps_navigation.dart file.
Expand Down
7 changes: 0 additions & 7 deletions example/integration_test/t07_event_listener_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
));
await $.pumpAndSettle();
Expand Down Expand Up @@ -109,7 +108,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
));
await $.pumpAndSettle();
Expand Down Expand Up @@ -173,7 +171,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
),
numNextStepsToPreview: 1);
Expand Down Expand Up @@ -232,7 +229,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
));
await $.pumpAndSettle();
Expand Down Expand Up @@ -321,7 +317,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
));

Expand Down Expand Up @@ -365,7 +360,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
));

Expand Down Expand Up @@ -439,7 +433,6 @@ void main() {
eventReceived.complete();
}
},
count: 1,
max: -1,
));
await $.pumpAndSettle();
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class _CameraPageState extends ExamplePageState<CameraPage> {
.elevatedButtonTheme
.style!
.copyWith(
minimumSize: MaterialStateProperty.all<Size>(const Size(107, 36)));
minimumSize: WidgetStateProperty.all<Size>(const Size(107, 36)));

return Column(
mainAxisSize: MainAxisSize.min,
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ description: Demonstrates how to use the google_maps_navigation plugin.
publish_to: "none"

environment:
sdk: ">=3.1.0 <4.0.0"
sdk: ^3.4.0

dependencies:
cupertino_icons: ^1.0.2
Expand All @@ -35,9 +35,9 @@ dev_dependencies:
sdk: flutter
integration_test:
sdk: flutter
patrol: ">=3.3.0 <3.4.0"
patrol_finders: "<2.1.0"
patrol: ^3.7.2
pub_semver: ^2.1.4
test_api: any

flutter:
uses-material-design: true
Expand Down
20 changes: 10 additions & 10 deletions lib/src/google_maps_navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -666,18 +666,18 @@ class GoogleNavigationViewController {
/// Sets the event channel listener for the map click event listeners.
void _setOnMapClickedListeners() {
if (_viewState != null) {
if (_viewState?.widget.onMapClicked != null) {
if (_viewState.widget.onMapClicked != null) {
GoogleMapsNavigationPlatform.instance
.getMapClickEventStream(viewId: _viewId)
.listen((MapClickEvent event) {
_viewState!.widget.onMapClicked!(event.target);
_viewState.widget.onMapClicked!(event.target);
});
}
if (_viewState?.widget.onMapLongClicked != null) {
if (_viewState.widget.onMapLongClicked != null) {
GoogleMapsNavigationPlatform.instance
.getMapLongClickEventStream(viewId: _viewId)
.listen((MapLongClickEvent event) {
_viewState!.widget.onMapLongClicked!(event.target);
_viewState.widget.onMapLongClicked!(event.target);
});
}
}
Expand All @@ -686,10 +686,10 @@ class GoogleNavigationViewController {
/// Sets the event channel listener for the on recenter button clicked event.
void _setOnRecenterButtonClickedListener() {
if (_viewState != null &&
_viewState?.widget.onRecenterButtonClicked != null) {
_viewState.widget.onRecenterButtonClicked != null) {
GoogleMapsNavigationPlatform.instance
.getNavigationRecenterButtonClickedEventStream(viewId: _viewId)
.listen(_viewState?.widget.onRecenterButtonClicked);
.listen(_viewState.widget.onRecenterButtonClicked);
}
}

Expand All @@ -714,20 +714,20 @@ class GoogleNavigationViewController {

/// Sets the event channel listener for the on my location clicked event.
void _setOnMyLocationClickedListener() {
if (_viewState != null && _viewState?.widget.onMyLocationClicked != null) {
if (_viewState != null && _viewState.widget.onMyLocationClicked != null) {
GoogleMapsNavigationPlatform.instance
.getMyLocationClickedEventStream(viewId: _viewId)
.listen(_viewState?.widget.onMyLocationClicked);
.listen(_viewState.widget.onMyLocationClicked);
}
}

/// Sets the event channel listener for the on my location button clicked event.
void _setOnMyLocationButtonClickedListener() {
if (_viewState != null &&
_viewState?.widget.onMyLocationButtonClicked != null) {
_viewState.widget.onMyLocationButtonClicked != null) {
GoogleMapsNavigationPlatform.instance
.getMyLocationButtonClickedEventStream(viewId: _viewId)
.listen(_viewState?.widget.onMyLocationButtonClicked);
.listen(_viewState.widget.onMyLocationButtonClicked);
}
}

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ name: google_maps_navigation
description: A Google Maps Navigation plugin
repository: https://github.com/googlemaps/flutter-navigation-sdk
issue_tracker: https://github.com/googlemaps/flutter-navigation-sdk/issues
version: 0.2.2-beta
version: 0.2.3-beta
publish_to: none

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.3.0"
sdk: ^3.4.0
flutter: ">=3.22.1"

dependencies:
collection: ^1.17.2
Expand Down

0 comments on commit 8903912

Please sign in to comment.