Skip to content

Commit d95d3a3

Browse files
feat!: upgrade to latest sdks (#142)
* feat: upgrade package and sdk versions * chore: update to swift-format and re-format codebase * ci: update flutter version for ci * ci: use newer iOS simulator version * chore: update analysis_options.yaml * chore: update packages * chore: update sdks and fix errors * fix: flutter analyze fixes * chore: formatting * chore: disable swift-format ci pipeline cache check * test: android test fix * docs: update ios min version to readme --------- Co-authored-by: Ville Välimaa <[email protected]>
1 parent e492334 commit d95d3a3

File tree

80 files changed

+4685
-3939
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+4685
-3939
lines changed

.github/workflows/analyze.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
3232
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
3333
with:
34-
flutter-version: "3.22.x"
34+
flutter-version: "3.32.x"
3535
channel: "stable"
3636
cache: true
3737
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
@@ -56,13 +56,14 @@ jobs:
5656
path: /home/linuxbrew/.linuxbrew
5757
key: ${{ runner.os }}-linuxbrew
5858
- uses: Homebrew/actions/setup-homebrew@master
59-
- name: "Install swiftformat v0.53"
60-
if: steps.cache.outputs.cache-hit != 'true'
59+
- name: Install swift-format 600.0.0
60+
#if: steps.cache.outputs.cache-hit != 'true'
6161
run: |
62+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
6263
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
63-
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/86f85aaa82beba49f8a5aabf3a22508c9249f188/Formula/s/swiftformat.rb
64-
grep -qxF 'brew "swiftformat.rb"' Brewfile || echo 'brew "swiftformat.rb"' >> Brewfile
65-
brew bundle --force
64+
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/402e262f48947bad849ea7793752ff16b7038406/Formula/s/swift-format.rb
65+
echo 'brew "swift-format.rb"' > Brewfile
66+
brew bundle
6667
- name: Save Cache
6768
uses: actions/cache/save@v4
6869
if: steps.cache.outputs.cache-hit != 'true'
@@ -71,15 +72,16 @@ jobs:
7172
key: ${{ runner.os }}-linuxbrew
7273
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
7374
with:
74-
flutter-version: "3.22.x"
75+
flutter-version: "3.32.x"
7576
channel: "stable"
7677
cache: true
7778
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
7879
with:
7980
melos-version: "6.0.0"
8081
- name: "Formatter version"
8182
run: |
82-
swiftformat --version
83+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
84+
swift-format --version
8385
- name: "Run format"
8486
if: ${{ success() || failure() }}
8587
run: |

.github/workflows/build.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
cache: "gradle"
3838
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
3939
with:
40-
flutter-version: "3.22.x"
40+
flutter-version: "3.32.x"
4141
channel: "stable"
4242
cache: true
4343
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
@@ -59,7 +59,7 @@ jobs:
5959
cache: "gradle"
6060
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
6161
with:
62-
flutter-version: "3.22.x"
62+
flutter-version: "3.32.x"
6363
channel: "stable"
6464
cache: true
6565
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
@@ -85,17 +85,19 @@ jobs:
8585
${{ runner.os }}-pods-
8686
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
8787
with:
88-
flutter-version: "3.22.x"
88+
flutter-version: "3.32.x"
8989
channel: "stable"
9090
cache: true
9191
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
9292
with:
9393
melos-version: "6.0.0"
94+
- name: Select XCode 16.1
95+
run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer'
9496
- name: Generate necessary files with flutter build
9597
working-directory: ${{ matrix.working_directory }}
9698
run: flutter build ios --config-only
9799
- name: "Run iOS native unit tests"
98-
run: DEVICE='iPhone 14 Pro' melos run test:ios
100+
run: TEST_DEVICE='iPhone 16 Pro' TEST_OS='18.1' melos run test:ios
99101

100102
build-android:
101103
needs: [test-dart, test-android, test-ios]
@@ -114,7 +116,7 @@ jobs:
114116
cache: "gradle"
115117
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
116118
with:
117-
flutter-version: "3.22.x"
119+
flutter-version: "3.32.x"
118120
channel: "stable"
119121
cache: true
120122
- uses: bluefireteam/melos-action@6085791af7036f6366c9a4b9d55105c0ef9c6388
@@ -134,7 +136,7 @@ jobs:
134136
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
135137
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
136138
with:
137-
flutter-version: "3.22.x"
139+
flutter-version: "3.32.x"
138140
channel: "stable"
139141
cache: true
140142
architecture: x64
@@ -147,5 +149,7 @@ jobs:
147149
key: ${{ runner.os }}-pods-${{ hashFiles('**/*.podspec') }}
148150
restore-keys: |
149151
${{ runner.os }}-pods-
152+
- name: Select XCode 16.1
153+
run: sudo xcode-select -s '/Applications/Xcode_16.1.0.app/Contents/Developer'
150154
- name: "Run build for iOS"
151155
run: melos run flutter-build-ios

.github/workflows/licence-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Install Flutter
3939
uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1
4040
with:
41-
flutter-version: "3.22.x"
41+
flutter-version: "3.32.x"
4242
channel: "stable"
4343
cache: true
4444
- name: Install Melos

.swiftformat

Lines changed: 0 additions & 6 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ _See also: [Flutter's code of conduct](https://flutter.io/design-principles/#cod
77
- **Operating System:** Linux, macOS, or Windows.
88
- **Version Control:** [git](https://git-scm.com).
99
- **Development Environment:** An IDE such as [Android Studio](https://developer.android.com/studio) or [Visual Studio Code](https://code.visualstudio.com/).
10-
- **Code Formatting:** [`swiftformat`](https://github.com/nicklockwood/SwiftFormat) (available via brew on macOS, on Windows install Swift toolchain and build SwiftFormat from git sources).
10+
- **Code Formatting:** [`swift-format`](https://formulae.brew.sh/formula/swift-formatt).
1111

12-
### 1.1. Installing swiftformat
13-
The CI is locked to swiftformat 0.53 version which you can install with the command below:
12+
### 1.1. Installing swift-format
13+
The CI is locked to swift-format 600.0.0 version which you can install with the command below:
1414
```bash
15-
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/86f85aaa82beba49f8a5aabf3a22508c9249f188/Formula/s/swiftformat.rb
16-
brew install swiftformat.rb
15+
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/402e262f48947bad849ea7793752ff16b7038406/Formula/s/swift-format.rb
16+
brew install swift-format.rb
1717
```
1818

1919
## 2. Setting Up Your Local Repository

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This repository contains a Flutter plugin that allows users to use the [Google M
1414

1515
| | Android | iOS |
1616
| ----------- | ------- | --------- |
17-
| **Support** | SDK 23+ | iOS 14.0+ |
17+
| **Support** | SDK 23+ | iOS 16.0+ |
1818

1919
* A Flutter project
2020
* 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)

analysis_options.yaml

Lines changed: 6 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -19,224 +19,16 @@
1919
# "DIFFERENT FROM FLUTTER/FLUTTER" below. The file is expected to
2020
# be kept in sync with the master file from the flutter repo.
2121

22+
include: package:flutter_lints/flutter.yaml
23+
2224
analyzer:
2325
language:
2426
strict-casts: true
2527
strict-raw-types: true
2628
errors:
27-
# allow self-reference to deprecated members (we do this because otherwise we have
28-
# to annotate every member in every test, assert, etc, when we deprecate something)
29+
# allow self-reference to deprecated members
2930
deprecated_member_use_from_same_package: ignore
30-
exclude: # DIFFERENT FROM FLUTTER/FLUTTER
31+
exclude:
3132
# Ignore generated files
32-
- '**/*.g.dart'
33-
- '**/*.mocks.dart' # Mockito @GenerateMocks
34-
35-
linter:
36-
rules:
37-
# This list is derived from the list of all available lints located at
38-
# https://github.com/dart-lang/linter/blob/master/example/all.yaml
39-
- always_declare_return_types
40-
- always_put_control_body_on_new_line
41-
- always_specify_types
42-
# - always_use_package_imports
43-
- annotate_overrides
44-
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
45-
- avoid_bool_literals_in_conditional_expressions
46-
# - avoid_catches_without_on_clauses # blocked on https://github.com/dart-lang/linter/issues/3023
47-
# - avoid_catching_errors # blocked on https://github.com/dart-lang/linter/issues/3023
48-
# - avoid_classes_with_only_static_members
49-
- avoid_double_and_int_checks
50-
- avoid_dynamic_calls
51-
- avoid_empty_else
52-
- avoid_equals_and_hash_code_on_mutable_classes
53-
- avoid_escaping_inner_quotes
54-
- avoid_field_initializers_in_const_classes
55-
# - avoid_final_parameters # incompatible with prefer_final_parameters
56-
- avoid_function_literals_in_foreach_calls
57-
- avoid_implementing_value_types
58-
- avoid_init_to_null
59-
- avoid_js_rounded_ints
60-
# - avoid_multiple_declarations_per_line
61-
- avoid_null_checks_in_equality_operators
62-
# - avoid_positional_boolean_parameters
63-
- avoid_print
64-
# - avoid_private_typedef_functions # project prefers having typedef
65-
- avoid_redundant_argument_values
66-
- avoid_relative_lib_imports
67-
- avoid_renaming_method_parameters
68-
- avoid_return_types_on_setters
69-
- avoid_returning_null_for_void
70-
# - avoid_returning_this
71-
- avoid_setters_without_getters
72-
- avoid_shadowing_type_parameters
73-
- avoid_single_cascade_in_expression_statements
74-
- avoid_slow_async_io
75-
- avoid_type_to_string
76-
- avoid_types_as_parameter_names
77-
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
78-
- avoid_unnecessary_containers
79-
- avoid_unused_constructor_parameters
80-
- avoid_void_async
81-
- avoid_web_libraries_in_flutter
82-
- await_only_futures
83-
- camel_case_extensions
84-
- camel_case_types
85-
- cancel_subscriptions
86-
# - cascade_invocations # doesn't match the typical style of this repo
87-
- cast_nullable_to_non_nullable
88-
# - close_sinks # not reliable enough
89-
- collection_methods_unrelated_type
90-
# - combinators_ordering # DIFFERENT FROM FLUTTER/FLUTTER: This isn't available on stable yet.
91-
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
92-
- conditional_uri_does_not_exist
93-
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
94-
- control_flow_in_finally
95-
- curly_braces_in_flow_control_structures
96-
- dangling_library_doc_comments
97-
# - depend_on_referenced_packages # project uses dependency overrides
98-
- deprecated_consistency
99-
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
100-
- directives_ordering
101-
# - discarded_futures # not yet tested
102-
# - do_not_use_environment # there are appropriate times to use the environment, especially in our tests and build logic
103-
- empty_catches
104-
- empty_constructor_bodies
105-
- empty_statements
106-
- eol_at_end_of_file
107-
- exhaustive_cases
108-
- file_names
109-
- flutter_style_todos
110-
- hash_and_equals
111-
- implementation_imports
112-
- implicit_call_tearoffs
113-
# - join_return_with_assignment # not required by flutter style
114-
- leading_newlines_in_multiline_strings
115-
- library_names
116-
- library_prefixes
117-
- library_private_types_in_public_api
118-
# - lines_longer_than_80_chars # not required by flutter style
119-
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/linter/issues/453
120-
- missing_whitespace_between_adjacent_strings
121-
- no_adjacent_strings_in_list
122-
- no_default_cases
123-
- no_duplicate_case_values
124-
- no_leading_underscores_for_library_prefixes
125-
- no_leading_underscores_for_local_identifiers
126-
- no_logic_in_create_state
127-
- no_runtimeType_toString # DIFFERENT FROM FLUTTER/FLUTTER
128-
- non_constant_identifier_names
129-
- noop_primitive_operations
130-
- null_check_on_nullable_type_parameter
131-
- null_closures
132-
# - omit_local_variable_types # opposite of always_specify_types
133-
# - one_member_abstracts # too many false positives
134-
- only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al
135-
- overridden_fields
136-
- package_api_docs
137-
- package_names
138-
- package_prefixed_library_names
139-
# - parameter_assignments # we do this commonly
140-
- prefer_adjacent_string_concatenation
141-
- prefer_asserts_in_initializer_lists
142-
# - prefer_asserts_with_message # not required by flutter style
143-
- prefer_collection_literals
144-
- prefer_conditional_assignment
145-
- prefer_const_constructors
146-
- prefer_const_constructors_in_immutables
147-
- prefer_const_declarations
148-
- prefer_const_literals_to_create_immutables
149-
# - prefer_constructors_over_static_methods # far too many false positives
150-
- prefer_contains
151-
# - prefer_double_quotes # opposite of prefer_single_quotes
152-
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
153-
- prefer_final_fields
154-
- prefer_final_in_for_each
155-
- prefer_final_locals
156-
# - prefer_final_parameters # we should enable this one day when it can be auto-fixed (https://github.com/dart-lang/linter/issues/3104), see also parameter_assignments
157-
- prefer_for_elements_to_map_fromIterable
158-
- prefer_foreach
159-
- prefer_function_declarations_over_variables
160-
- prefer_generic_function_type_aliases
161-
- prefer_if_elements_to_conditional_expressions
162-
- prefer_if_null_operators
163-
- prefer_initializing_formals
164-
- prefer_inlined_adds
165-
# - prefer_int_literals # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#use-double-literals-for-double-constants
166-
- prefer_interpolation_to_compose_strings
167-
- prefer_is_empty
168-
- prefer_is_not_empty
169-
- prefer_is_not_operator
170-
- prefer_iterable_whereType
171-
# - prefer_mixin # Has false positives, see https://github.com/dart-lang/linter/issues/3018
172-
# - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere
173-
- prefer_null_aware_operators
174-
- prefer_relative_imports
175-
- prefer_single_quotes
176-
- prefer_spread_collections
177-
- prefer_typing_uninitialized_variables
178-
- provide_deprecation_message
179-
- public_member_api_docs # DIFFERENT FROM FLUTTER/FLUTTER
180-
- recursive_getters
181-
# - require_trailing_commas # blocked on https://github.com/dart-lang/sdk/issues/47441
182-
- secure_pubspec_urls
183-
- sized_box_for_whitespace
184-
# - sized_box_shrink_expand # not yet tested
185-
- slash_for_doc_comments
186-
- sort_child_properties_last
187-
- sort_constructors_first
188-
- sort_pub_dependencies # DIFFERENT FROM FLUTTER/FLUTTER: Flutter's use case for not sorting does not apply to this repository.
189-
- sort_unnamed_constructors_first
190-
- test_types_in_equals
191-
- throw_in_finally
192-
- tighten_type_of_initializing_formals
193-
# - type_annotate_public_apis # subset of always_specify_types
194-
- type_init_formals
195-
- type_literal_in_constant_pattern
196-
- unawaited_futures # DIFFERENT FROM FLUTTER/FLUTTER: It's disabled there for "too many false positives"; that's not an issue here, and missing awaits have caused production issues in plugins.
197-
- unnecessary_await_in_return
198-
- unnecessary_brace_in_string_interps
199-
- unnecessary_const
200-
- unnecessary_constructor_name
201-
# - unnecessary_final # conflicts with prefer_final_locals
202-
- unnecessary_getters_setters
203-
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
204-
- unnecessary_late
205-
- unnecessary_new
206-
- unnecessary_null_aware_assignments
207-
- unnecessary_null_aware_operator_on_extension_on_nullable
208-
- unnecessary_null_checks
209-
- unnecessary_null_in_if_null_operators
210-
- unnecessary_nullable_for_final_variable_declarations
211-
- unnecessary_overrides
212-
- unnecessary_parenthesis
213-
# - unnecessary_raw_strings # what's "necessary" is a matter of opinion; consistency across strings can help readability more than this lint
214-
- unnecessary_statements
215-
- unnecessary_string_escapes
216-
- unnecessary_string_interpolations
217-
- unnecessary_this
218-
- unnecessary_to_list_in_spreads
219-
- unrelated_type_equality_checks
220-
- unsafe_html
221-
- use_build_context_synchronously
222-
# - use_colored_box # not yet tested
223-
# - use_decorated_box # not yet tested
224-
# - use_enums # not yet tested
225-
- use_full_hex_values_for_flutter_colors
226-
- use_function_type_syntax_for_parameters
227-
- use_if_null_to_convert_nulls_to_bools
228-
- use_is_even_rather_than_modulo
229-
- use_key_in_widget_constructors
230-
- use_late_for_private_fields_and_variables
231-
- use_named_constants
232-
- use_raw_strings
233-
- use_rethrow_when_possible
234-
- use_setters_to_change_properties
235-
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
236-
- use_string_in_part_of_directives
237-
- use_super_parameters
238-
- use_test_throws_matchers
239-
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
240-
- valid_regexps
241-
- void_checks
242-
33+
- "**/*.g.dart"
34+
- "**/*.mocks.dart" # Mockito @GenerateMocks

0 commit comments

Comments
 (0)