Skip to content

Commit e145c32

Browse files
Merge remote-tracking branch 'upstream/main' into update-goldens
2 parents e8bc959 + 11aab47 commit e145c32

File tree

131 files changed

+4799
-2785
lines changed

Some content is hidden

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

131 files changed

+4799
-2785
lines changed

.ci/flutter_master.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d8a7211061084525a992664d997cff9349fa43d3
1+
67e5f663d075f31b251e22bb9a6b2c5c6744f448

.ci/scripts/create_simulator.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
device=com.apple.CoreSimulator.SimDeviceType.iPhone-13
7-
os=com.apple.CoreSimulator.SimRuntime.iOS-16-0
6+
# The name here must match remove_simulator.sh
7+
readonly DEVICE_NAME=Flutter-iPhone
8+
readonly DEVICE=com.apple.CoreSimulator.SimDeviceType.iPhone-13
9+
readonly OS=com.apple.CoreSimulator.SimRuntime.iOS-16-0
810

911
xcrun simctl list
10-
xcrun simctl create Flutter-iPhone "$device" "$os" | xargs xcrun simctl boot
12+
xcrun simctl create "$DEVICE_NAME" "$DEVICE" "$OS" | xargs xcrun simctl boot

.ci/scripts/remove_simulator.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# Copyright 2013 The Flutter Authors. All rights reserved.
3+
# Use of this source code is governed by a BSD-style license that can be
4+
# found in the LICENSE file.
5+
6+
# The name here must match create_simulator.sh
7+
readonly DEVICE_NAME=Flutter-iPhone
8+
9+
xcrun simctl shutdown "$DEVICE_NAME"
10+
xcrun simctl delete "$DEVICE_NAME"
11+
xcrun simctl list

.ci/targets/ios_platform_tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ tasks:
2222
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
2323
script: script/tool_runner.sh
2424
args: ["drive-examples", "--ios", "--exclude=script/configs/exclude_integration_ios.yaml"]
25+
- name: remove simulator
26+
script: .ci/scripts/remove_simulator.sh

.ci/targets/macos_custom_package_tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ tasks:
55
script: .ci/scripts/create_simulator.sh
66
- name: custom package tests
77
script: .ci/scripts/custom_package_tests.sh
8+
- name: remove simulator
9+
script: .ci/scripts/remove_simulator.sh

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ task:
9797
license_script: $PLUGIN_TOOL_COMMAND license-check
9898
# The major and minor version here should match the lowest version
9999
# analyzed in legacy_version_analyze.
100-
pubspec_script: ./script/tool_runner.sh pubspec-check --min-min-flutter-version=3.0.0
100+
pubspec_script: ./script/tool_runner.sh pubspec-check --min-min-flutter-version=3.0.0 --allow-dependencies=script/configs/allowed_unpinned_deps.yaml --allow-pinned-dependencies=script/configs/allowed_pinned_deps.yaml
101101
readme_script:
102102
- ./script/tool_runner.sh readme-check
103103
# Re-run with --require-excerpts, skipping packages that still need

packages/camera/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ dev_dependencies:
3535
sdk: flutter
3636
flutter_test:
3737
sdk: flutter
38-
mockito: ^5.0.0
38+
mockito: 5.3.2
3939
plugin_platform_interface: ^2.0.0
4040
video_player: ^2.0.0

packages/camera/camera_android_camerax/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ dev_dependencies:
3030
build_runner: ^2.1.4
3131
flutter_test:
3232
sdk: flutter
33-
mockito: ^5.3.2
33+
mockito: 5.3.2
3434
pigeon: ^3.2.6

packages/camera/camera_web/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ dev_dependencies:
2121
sdk: flutter
2222
integration_test:
2323
sdk: flutter
24-
mocktail: ^0.3.0
24+
mocktail: 0.3.0

packages/file_selector/file_selector_ios/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ dev_dependencies:
2525
build_runner: 2.1.11
2626
flutter_test:
2727
sdk: flutter
28-
mockito: ^5.1.0
28+
mockito: 5.3.2
2929
pigeon: ^3.2.5
3030

packages/file_selector/file_selector_macos/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ dev_dependencies:
2626
build_runner: ^2.3.2
2727
flutter_test:
2828
sdk: flutter
29-
mockito: ^5.3.2
29+
mockito: 5.3.2
3030
pigeon: ^4.2.14

packages/file_selector/file_selector_windows/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ dev_dependencies:
2626
build_runner: 2.1.11
2727
flutter_test:
2828
sdk: flutter
29-
mockito: ^5.1.0
29+
mockito: 5.3.2
3030
pigeon: ^3.2.5

packages/flutter_markdown/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ dependencies:
2020
dev_dependencies:
2121
flutter_test:
2222
sdk: flutter
23-
mockito: ^5.0.0
23+
mockito: 5.3.2
2424
standard_message_codec: ^0.0.1+3

packages/flutter_migrate/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222

2323
dev_dependencies:
2424
collection: 1.16.0
25-
file_testing: ^3.0.0
25+
file_testing: 3.0.0
2626
lints: ^2.0.0
2727
test: ^1.16.0
2828
test_api: ^0.4.13

packages/go_router/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
flutter: ">=3.3.0"
99

1010
dependencies:
11-
adaptive_dialog: ^1.2.0
11+
adaptive_dialog: 1.8.2
1212
adaptive_navigation: ^0.0.4
1313
collection: ^1.15.0
1414
cupertino_icons: ^1.0.2
@@ -17,7 +17,7 @@ dependencies:
1717
go_router:
1818
path: ..
1919
logging: ^1.0.0
20-
provider: ^6.0.0
20+
provider: 6.0.5
2121
shared_preferences: ^2.0.11
2222
url_launcher: ^6.0.7
2323

packages/go_router_builder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.7
2+
3+
* Supports default values for `Set`, `List` and `Iterable` route parameters.
4+
15
## 1.1.6
26

37
* Generates the const enum map for enums used in `List`, `Set` and `Iterable`.

packages/go_router_builder/example/lib/all_types.dart

Lines changed: 156 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ part 'all_types.g.dart';
2525
TypedGoRoute<StringRoute>(path: 'string-route/:requiredStringField'),
2626
TypedGoRoute<UriRoute>(path: 'uri-route/:requiredUriField'),
2727
TypedGoRoute<IterableRoute>(path: 'iterable-route'),
28+
TypedGoRoute<IterableRouteWithDefaultValues>(
29+
path: 'iterable-route-with-default-values'),
2830
])
2931
@immutable
3032
class AllTypesBaseRoute extends GoRouteData {
@@ -337,9 +339,23 @@ class IterableRoute extends GoRouteData {
337339
final Set<CookingRecipe>? enumOnlyInSetField;
338340

339341
@override
340-
Widget build(BuildContext context, GoRouterState state) =>
341-
const BasePage<String>(
342+
Widget build(BuildContext context, GoRouterState state) => IterablePage(
342343
dataTitle: 'IterableRoute',
344+
intIterableField: intIterableField,
345+
doubleIterableField: doubleIterableField,
346+
stringIterableField: stringIterableField,
347+
boolIterableField: boolIterableField,
348+
enumIterableField: enumIterableField,
349+
intListField: intListField,
350+
doubleListField: doubleListField,
351+
stringListField: stringListField,
352+
boolListField: boolListField,
353+
enumListField: enumListField,
354+
intSetField: intSetField,
355+
doubleSetField: doubleSetField,
356+
stringSetField: stringSetField,
357+
boolSetField: boolSetField,
358+
enumSetField: enumSetField,
343359
);
344360

345361
Widget drawerTile(BuildContext context) => ListTile(
@@ -349,6 +365,75 @@ class IterableRoute extends GoRouteData {
349365
);
350366
}
351367

368+
class IterableRouteWithDefaultValues extends GoRouteData {
369+
const IterableRouteWithDefaultValues({
370+
this.intIterableField = const <int>[0],
371+
this.doubleIterableField = const <double>[0, 1, 2],
372+
this.stringIterableField = const <String>['defaultValue'],
373+
this.boolIterableField = const <bool>[false],
374+
this.enumIterableField = const <SportDetails>[
375+
SportDetails.tennis,
376+
SportDetails.hockey,
377+
],
378+
this.intListField = const <int>[0],
379+
this.doubleListField = const <double>[1, 2, 3],
380+
this.stringListField = const <String>['defaultValue0', 'defaultValue1'],
381+
this.boolListField = const <bool>[true],
382+
this.enumListField = const <SportDetails>[SportDetails.football],
383+
this.intSetField = const <int>{0, 1},
384+
this.doubleSetField = const <double>{},
385+
this.stringSetField = const <String>{'defaultValue'},
386+
this.boolSetField = const <bool>{true, false},
387+
this.enumSetField = const <SportDetails>{SportDetails.hockey},
388+
});
389+
390+
final Iterable<int> intIterableField;
391+
final List<int> intListField;
392+
final Set<int> intSetField;
393+
394+
final Iterable<double> doubleIterableField;
395+
final List<double> doubleListField;
396+
final Set<double> doubleSetField;
397+
398+
final Iterable<String> stringIterableField;
399+
final List<String> stringListField;
400+
final Set<String> stringSetField;
401+
402+
final Iterable<bool> boolIterableField;
403+
final List<bool> boolListField;
404+
final Set<bool> boolSetField;
405+
406+
final Iterable<SportDetails> enumIterableField;
407+
final List<SportDetails> enumListField;
408+
final Set<SportDetails> enumSetField;
409+
410+
@override
411+
Widget build(BuildContext context, GoRouterState state) => IterablePage(
412+
dataTitle: 'IterableRouteWithDefaultValues',
413+
intIterableField: intIterableField,
414+
doubleIterableField: doubleIterableField,
415+
stringIterableField: stringIterableField,
416+
boolIterableField: boolIterableField,
417+
enumIterableField: enumIterableField,
418+
intListField: intListField,
419+
doubleListField: doubleListField,
420+
stringListField: stringListField,
421+
boolListField: boolListField,
422+
enumListField: enumListField,
423+
intSetField: intSetField,
424+
doubleSetField: doubleSetField,
425+
stringSetField: stringSetField,
426+
boolSetField: boolSetField,
427+
enumSetField: enumSetField,
428+
);
429+
430+
Widget drawerTile(BuildContext context) => ListTile(
431+
title: const Text('IterableRouteWithDefaultValues'),
432+
onTap: () => go(context),
433+
selected: GoRouter.of(context).location == location,
434+
);
435+
}
436+
352437
class BasePage<T> extends StatelessWidget {
353438
const BasePage({
354439
required this.dataTitle,
@@ -437,6 +522,7 @@ class BasePage<T> extends StatelessWidget {
437522
SportDetails.hockey,
438523
},
439524
).drawerTile(context),
525+
const IterableRouteWithDefaultValues().drawerTile(context),
440526
],
441527
)),
442528
body: Center(
@@ -475,3 +561,71 @@ class AllTypesApp extends StatelessWidget {
475561
initialLocation: const AllTypesBaseRoute().location,
476562
);
477563
}
564+
565+
class IterablePage extends StatelessWidget {
566+
const IterablePage({
567+
required this.dataTitle,
568+
this.intIterableField,
569+
this.doubleIterableField,
570+
this.stringIterableField,
571+
this.boolIterableField,
572+
this.enumIterableField,
573+
this.intListField,
574+
this.doubleListField,
575+
this.stringListField,
576+
this.boolListField,
577+
this.enumListField,
578+
this.intSetField,
579+
this.doubleSetField,
580+
this.stringSetField,
581+
this.boolSetField,
582+
this.enumSetField,
583+
super.key,
584+
});
585+
586+
final String dataTitle;
587+
588+
final Iterable<int>? intIterableField;
589+
final List<int>? intListField;
590+
final Set<int>? intSetField;
591+
592+
final Iterable<double>? doubleIterableField;
593+
final List<double>? doubleListField;
594+
final Set<double>? doubleSetField;
595+
596+
final Iterable<String>? stringIterableField;
597+
final List<String>? stringListField;
598+
final Set<String>? stringSetField;
599+
600+
final Iterable<bool>? boolIterableField;
601+
final List<bool>? boolListField;
602+
final Set<bool>? boolSetField;
603+
604+
final Iterable<SportDetails>? enumIterableField;
605+
final List<SportDetails>? enumListField;
606+
final Set<SportDetails>? enumSetField;
607+
608+
@override
609+
Widget build(BuildContext context) {
610+
return BasePage<String>(
611+
dataTitle: dataTitle,
612+
queryParamWithDefaultValue: <String, Iterable<dynamic>?>{
613+
'intIterableField': intIterableField,
614+
'intListField': intListField,
615+
'intSetField': intSetField,
616+
'doubleIterableField': doubleIterableField,
617+
'doubleListField': doubleListField,
618+
'doubleSetField': doubleSetField,
619+
'stringIterableField': stringIterableField,
620+
'stringListField': stringListField,
621+
'stringSetField': stringSetField,
622+
'boolIterableField': boolIterableField,
623+
'boolListField': boolListField,
624+
'boolSetField': boolSetField,
625+
'enumIterableField': enumIterableField,
626+
'enumListField': enumListField,
627+
'enumSetField': enumSetField,
628+
}.toString(),
629+
);
630+
}
631+
}

0 commit comments

Comments
 (0)