diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md index 74665333fc..cb3433fb37 100644 --- a/packages/go_router_builder/CHANGELOG.md +++ b/packages/go_router_builder/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.4 + +* Bumps example go_router version to v10.0.0 and migrate example code. + ## 2.2.3 * Removes `path_to_regexp` from the dependencies. diff --git a/packages/go_router_builder/example/lib/all_types.dart b/packages/go_router_builder/example/lib/all_types.dart index e5506d5b1a..762ab1cea9 100644 --- a/packages/go_router_builder/example/lib/all_types.dart +++ b/packages/go_router_builder/example/lib/all_types.dart @@ -58,7 +58,7 @@ class BigIntRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('BigIntRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -84,7 +84,7 @@ class BoolRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('BoolRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -107,7 +107,7 @@ class DateTimeRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('DateTimeRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -133,7 +133,7 @@ class DoubleRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('DoubleRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -159,7 +159,7 @@ class IntRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('IntRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -185,7 +185,7 @@ class NumRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('NumRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -212,7 +212,7 @@ class EnumRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('EnumRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -239,7 +239,7 @@ class EnhancedEnumRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('EnhancedEnumRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -265,7 +265,7 @@ class StringRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('StringRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -288,7 +288,7 @@ class UriRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('UriRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -361,7 +361,7 @@ class IterableRoute extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('IterableRoute'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -430,7 +430,7 @@ class IterableRouteWithDefaultValues extends GoRouteData { Widget drawerTile(BuildContext context) => ListTile( title: const Text('IterableRouteWithDefaultValues'), onTap: () => go(context), - selected: GoRouterState.of(context).location == location, + selected: GoRouterState.of(context).uri.toString() == location, ); } @@ -536,7 +536,7 @@ class BasePage extends StatelessWidget { Text( 'Query param with default value: $queryParamWithDefaultValue', ), - SelectableText(GoRouterState.of(context).location), + SelectableText(GoRouterState.of(context).uri.toString()), ], ), ), diff --git a/packages/go_router_builder/example/lib/all_types.g.dart b/packages/go_router_builder/example/lib/all_types.g.dart index 1afdf3d735..cb672ab6c8 100644 --- a/packages/go_router_builder/example/lib/all_types.g.dart +++ b/packages/go_router_builder/example/lib/all_types.g.dart @@ -94,7 +94,7 @@ extension $BigIntRouteExtension on BigIntRoute { requiredBigIntField: BigInt.parse(state.pathParameters['requiredBigIntField']!), bigIntField: _$convertMapValue( - 'big-int-field', state.queryParameters, BigInt.parse), + 'big-int-field', state.uri.queryParameters, BigInt.parse), ); String get location => GoRouteData.$location( @@ -119,10 +119,10 @@ extension $BoolRouteExtension on BoolRoute { requiredBoolField: _$boolConverter(state.pathParameters['requiredBoolField']!), boolField: _$convertMapValue( - 'bool-field', state.queryParameters, _$boolConverter), + 'bool-field', state.uri.queryParameters, _$boolConverter), boolFieldWithDefaultValue: _$convertMapValue( 'bool-field-with-default-value', - state.queryParameters, + state.uri.queryParameters, _$boolConverter) ?? true, ); @@ -152,7 +152,7 @@ extension $DateTimeRouteExtension on DateTimeRoute { requiredDateTimeField: DateTime.parse(state.pathParameters['requiredDateTimeField']!), dateTimeField: _$convertMapValue( - 'date-time-field', state.queryParameters, DateTime.parse), + 'date-time-field', state.uri.queryParameters, DateTime.parse), ); String get location => GoRouteData.$location( @@ -178,10 +178,10 @@ extension $DoubleRouteExtension on DoubleRoute { requiredDoubleField: double.parse(state.pathParameters['requiredDoubleField']!), doubleField: _$convertMapValue( - 'double-field', state.queryParameters, double.parse), + 'double-field', state.uri.queryParameters, double.parse), doubleFieldWithDefaultValue: _$convertMapValue( 'double-field-with-default-value', - state.queryParameters, + state.uri.queryParameters, double.parse) ?? 1.0, ); @@ -209,11 +209,11 @@ extension $DoubleRouteExtension on DoubleRoute { extension $IntRouteExtension on IntRoute { static IntRoute _fromState(GoRouterState state) => IntRoute( requiredIntField: int.parse(state.pathParameters['requiredIntField']!), - intField: - _$convertMapValue('int-field', state.queryParameters, int.parse), + intField: _$convertMapValue( + 'int-field', state.uri.queryParameters, int.parse), intFieldWithDefaultValue: _$convertMapValue( 'int-field-with-default-value', - state.queryParameters, + state.uri.queryParameters, int.parse) ?? 1, ); @@ -240,11 +240,11 @@ extension $IntRouteExtension on IntRoute { extension $NumRouteExtension on NumRoute { static NumRoute _fromState(GoRouterState state) => NumRoute( requiredNumField: num.parse(state.pathParameters['requiredNumField']!), - numField: - _$convertMapValue('num-field', state.queryParameters, num.parse), + numField: _$convertMapValue( + 'num-field', state.uri.queryParameters, num.parse), numFieldWithDefaultValue: _$convertMapValue( 'num-field-with-default-value', - state.queryParameters, + state.uri.queryParameters, num.parse) ?? 1, ); @@ -272,11 +272,11 @@ extension $EnumRouteExtension on EnumRoute { static EnumRoute _fromState(GoRouterState state) => EnumRoute( requiredEnumField: _$PersonDetailsEnumMap ._$fromName(state.pathParameters['requiredEnumField']!), - enumField: _$convertMapValue('enum-field', state.queryParameters, + enumField: _$convertMapValue('enum-field', state.uri.queryParameters, _$PersonDetailsEnumMap._$fromName), enumFieldWithDefaultValue: _$convertMapValue( 'enum-field-with-default-value', - state.queryParameters, + state.uri.queryParameters, _$PersonDetailsEnumMap._$fromName) ?? PersonDetails.favoriteFood, ); @@ -312,11 +312,11 @@ extension $EnhancedEnumRouteExtension on EnhancedEnumRoute { static EnhancedEnumRoute _fromState(GoRouterState state) => EnhancedEnumRoute( requiredEnumField: _$SportDetailsEnumMap ._$fromName(state.pathParameters['requiredEnumField']!), - enumField: _$convertMapValue('enum-field', state.queryParameters, + enumField: _$convertMapValue('enum-field', state.uri.queryParameters, _$SportDetailsEnumMap._$fromName), enumFieldWithDefaultValue: _$convertMapValue( 'enum-field-with-default-value', - state.queryParameters, + state.uri.queryParameters, _$SportDetailsEnumMap._$fromName) ?? SportDetails.football, ); @@ -352,9 +352,9 @@ const _$SportDetailsEnumMap = { extension $StringRouteExtension on StringRoute { static StringRoute _fromState(GoRouterState state) => StringRoute( requiredStringField: state.pathParameters['requiredStringField']!, - stringField: state.queryParameters['string-field'], + stringField: state.uri.queryParameters['string-field'], stringFieldWithDefaultValue: - state.queryParameters['string-field-with-default-value'] ?? + state.uri.queryParameters['string-field-with-default-value'] ?? 'defaultValue', ); @@ -380,8 +380,8 @@ extension $StringRouteExtension on StringRoute { extension $UriRouteExtension on UriRoute { static UriRoute _fromState(GoRouterState state) => UriRoute( requiredUriField: Uri.parse(state.pathParameters['requiredUriField']!), - uriField: - _$convertMapValue('uri-field', state.queryParameters, Uri.parse), + uriField: _$convertMapValue( + 'uri-field', state.uri.queryParameters, Uri.parse), ); String get location => GoRouteData.$location( @@ -404,49 +404,56 @@ extension $UriRouteExtension on UriRoute { extension $IterableRouteExtension on IterableRoute { static IterableRoute _fromState(GoRouterState state) => IterableRoute( intIterableField: - state.queryParametersAll['int-iterable-field']?.map(int.parse), - doubleIterableField: state.queryParametersAll['double-iterable-field'] + state.uri.queryParametersAll['int-iterable-field']?.map(int.parse), + doubleIterableField: state + .uri.queryParametersAll['double-iterable-field'] ?.map(double.parse), - stringIterableField: - state.queryParametersAll['string-iterable-field']?.map((e) => e), - boolIterableField: state.queryParametersAll['bool-iterable-field'] + stringIterableField: state + .uri.queryParametersAll['string-iterable-field'] + ?.map((e) => e), + boolIterableField: state.uri.queryParametersAll['bool-iterable-field'] ?.map(_$boolConverter), - enumIterableField: state.queryParametersAll['enum-iterable-field'] + enumIterableField: state.uri.queryParametersAll['enum-iterable-field'] ?.map(_$SportDetailsEnumMap._$fromName), enumOnlyInIterableField: state - .queryParametersAll['enum-only-in-iterable-field'] + .uri.queryParametersAll['enum-only-in-iterable-field'] ?.map(_$CookingRecipeEnumMap._$fromName), - intListField: - state.queryParametersAll['int-list-field']?.map(int.parse).toList(), - doubleListField: state.queryParametersAll['double-list-field'] + intListField: state.uri.queryParametersAll['int-list-field'] + ?.map(int.parse) + .toList(), + doubleListField: state.uri.queryParametersAll['double-list-field'] ?.map(double.parse) .toList(), - stringListField: state.queryParametersAll['string-list-field'] + stringListField: state.uri.queryParametersAll['string-list-field'] ?.map((e) => e) .toList(), - boolListField: state.queryParametersAll['bool-list-field'] + boolListField: state.uri.queryParametersAll['bool-list-field'] ?.map(_$boolConverter) .toList(), - enumListField: state.queryParametersAll['enum-list-field'] + enumListField: state.uri.queryParametersAll['enum-list-field'] ?.map(_$SportDetailsEnumMap._$fromName) .toList(), - enumOnlyInListField: state.queryParametersAll['enum-only-in-list-field'] + enumOnlyInListField: state + .uri.queryParametersAll['enum-only-in-list-field'] ?.map(_$CookingRecipeEnumMap._$fromName) .toList(), - intSetField: - state.queryParametersAll['int-set-field']?.map(int.parse).toSet(), - doubleSetField: state.queryParametersAll['double-set-field'] + intSetField: state.uri.queryParametersAll['int-set-field'] + ?.map(int.parse) + .toSet(), + doubleSetField: state.uri.queryParametersAll['double-set-field'] ?.map(double.parse) .toSet(), - stringSetField: - state.queryParametersAll['string-set-field']?.map((e) => e).toSet(), - boolSetField: state.queryParametersAll['bool-set-field'] + stringSetField: state.uri.queryParametersAll['string-set-field'] + ?.map((e) => e) + .toSet(), + boolSetField: state.uri.queryParametersAll['bool-set-field'] ?.map(_$boolConverter) .toSet(), - enumSetField: state.queryParametersAll['enum-set-field'] + enumSetField: state.uri.queryParametersAll['enum-set-field'] ?.map(_$SportDetailsEnumMap._$fromName) .toSet(), - enumOnlyInSetField: state.queryParametersAll['enum-only-in-set-field'] + enumOnlyInSetField: state + .uri.queryParametersAll['enum-only-in-set-field'] ?.map(_$CookingRecipeEnumMap._$fromName) .toSet(), ); @@ -529,57 +536,60 @@ extension $IterableRouteWithDefaultValuesExtension on IterableRouteWithDefaultValues { static IterableRouteWithDefaultValues _fromState(GoRouterState state) => IterableRouteWithDefaultValues( - intIterableField: - state.queryParametersAll['int-iterable-field']?.map(int.parse) ?? - const [0], - doubleIterableField: state.queryParametersAll['double-iterable-field'] + intIterableField: state.uri.queryParametersAll['int-iterable-field'] + ?.map(int.parse) ?? + const [0], + doubleIterableField: state + .uri.queryParametersAll['double-iterable-field'] ?.map(double.parse) ?? const [0, 1, 2], - stringIterableField: - state.queryParametersAll['string-iterable-field']?.map((e) => e) ?? - const ['defaultValue'], - boolIterableField: state.queryParametersAll['bool-iterable-field'] + stringIterableField: state + .uri.queryParametersAll['string-iterable-field'] + ?.map((e) => e) ?? + const ['defaultValue'], + boolIterableField: state.uri.queryParametersAll['bool-iterable-field'] ?.map(_$boolConverter) ?? const [false], - enumIterableField: state.queryParametersAll['enum-iterable-field'] + enumIterableField: state.uri.queryParametersAll['enum-iterable-field'] ?.map(_$SportDetailsEnumMap._$fromName) ?? const [SportDetails.tennis, SportDetails.hockey], - intListField: state.queryParametersAll['int-list-field'] + intListField: state.uri.queryParametersAll['int-list-field'] ?.map(int.parse) .toList() ?? const [0], - doubleListField: state.queryParametersAll['double-list-field'] + doubleListField: state.uri.queryParametersAll['double-list-field'] ?.map(double.parse) .toList() ?? const [1, 2, 3], - stringListField: state.queryParametersAll['string-list-field'] + stringListField: state.uri.queryParametersAll['string-list-field'] ?.map((e) => e) .toList() ?? const ['defaultValue0', 'defaultValue1'], - boolListField: state.queryParametersAll['bool-list-field'] + boolListField: state.uri.queryParametersAll['bool-list-field'] ?.map(_$boolConverter) .toList() ?? const [true], - enumListField: state.queryParametersAll['enum-list-field'] + enumListField: state.uri.queryParametersAll['enum-list-field'] ?.map(_$SportDetailsEnumMap._$fromName) .toList() ?? const [SportDetails.football], - intSetField: - state.queryParametersAll['int-set-field']?.map(int.parse).toSet() ?? - const {0, 1}, - doubleSetField: state.queryParametersAll['double-set-field'] + intSetField: state.uri.queryParametersAll['int-set-field'] + ?.map(int.parse) + .toSet() ?? + const {0, 1}, + doubleSetField: state.uri.queryParametersAll['double-set-field'] ?.map(double.parse) .toSet() ?? const {}, - stringSetField: state.queryParametersAll['string-set-field'] + stringSetField: state.uri.queryParametersAll['string-set-field'] ?.map((e) => e) .toSet() ?? const {'defaultValue'}, - boolSetField: state.queryParametersAll['bool-set-field'] + boolSetField: state.uri.queryParametersAll['bool-set-field'] ?.map(_$boolConverter) .toSet() ?? const {true, false}, - enumSetField: state.queryParametersAll['enum-set-field'] + enumSetField: state.uri.queryParametersAll['enum-set-field'] ?.map(_$SportDetailsEnumMap._$fromName) .toSet() ?? const {SportDetails.hockey}, diff --git a/packages/go_router_builder/example/lib/main.g.dart b/packages/go_router_builder/example/lib/main.g.dart index c52640aff3..88c4f0ac84 100644 --- a/packages/go_router_builder/example/lib/main.g.dart +++ b/packages/go_router_builder/example/lib/main.g.dart @@ -158,7 +158,7 @@ RouteBase get $loginRoute => GoRouteData.$route( extension $LoginRouteExtension on LoginRoute { static LoginRoute _fromState(GoRouterState state) => LoginRoute( - fromPage: state.queryParameters['from-page'], + fromPage: state.uri.queryParameters['from-page'], ); String get location => GoRouteData.$location( diff --git a/packages/go_router_builder/example/lib/shell_route_example.dart b/packages/go_router_builder/example/lib/shell_route_example.dart index 979a31e728..77952c1133 100644 --- a/packages/go_router_builder/example/lib/shell_route_example.dart +++ b/packages/go_router_builder/example/lib/shell_route_example.dart @@ -77,7 +77,7 @@ class MyShellRouteScreen extends StatelessWidget { final Widget child; int getCurrentIndex(BuildContext context) { - final String location = GoRouterState.of(context).location; + final String location = GoRouterState.of(context).uri.toString(); if (location == '/bar') { return 1; } diff --git a/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart b/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart index b97ed47fc9..d18c0aa482 100644 --- a/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart +++ b/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart @@ -57,7 +57,7 @@ class MyShellRouteScreen extends StatelessWidget { final Widget child; int getCurrentIndex(BuildContext context) { - final String location = GoRouterState.of(context).location; + final String location = GoRouterState.of(context).uri.toString(); if (location.startsWith('/users')) { return 1; } diff --git a/packages/go_router_builder/example/pubspec.yaml b/packages/go_router_builder/example/pubspec.yaml index 4f83343fe5..3dea2475de 100644 --- a/packages/go_router_builder/example/pubspec.yaml +++ b/packages/go_router_builder/example/pubspec.yaml @@ -8,7 +8,7 @@ environment: dependencies: flutter: sdk: flutter - go_router: ^9.0.3 + go_router: ^10.0.0 provider: 6.0.5 dev_dependencies: diff --git a/packages/go_router_builder/lib/src/type_helpers.dart b/packages/go_router_builder/lib/src/type_helpers.dart index cea332a000..bd8cc7f31d 100644 --- a/packages/go_router_builder/lib/src/type_helpers.dart +++ b/packages/go_router_builder/lib/src/type_helpers.dart @@ -101,7 +101,7 @@ String _stateValueAccess(ParameterElement element, Set pathParameters) { if (pathParameters.contains(element.name)) { access = 'pathParameters[${escapeDartString(element.name)}]'; } else { - access = 'queryParameters[${escapeDartString(element.name.kebab)}]'; + access = 'uri.queryParameters[${escapeDartString(element.name.kebab)}]'; } if (pathParameters.contains(element.name) || (!element.type.isNullableType && !element.hasDefaultValue)) { @@ -284,12 +284,12 @@ class _TypeHelperIterable extends _TypeHelper { } return ''' -state.queryParametersAll[ +state.uri.queryParametersAll[ ${escapeDartString(parameterElement.name.kebab)}] ?.map($entriesTypeDecoder)$iterableCaster'''; } return ''' -state.queryParametersAll[${escapeDartString(parameterElement.name.kebab)}]'''; +state.uri.queryParametersAll[${escapeDartString(parameterElement.name.kebab)}]'''; } @override @@ -334,7 +334,7 @@ abstract class _TypeHelperWithHelper extends _TypeHelper { (paramType.isNullableType || parameterElement.hasDefaultValue)) { return '$convertMapValueHelperName(' '${escapeDartString(parameterName.kebab)}, ' - 'state.queryParameters, ' + 'state.uri.queryParameters, ' '${helperName(paramType)})'; } return '${helperName(paramType)}' diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 374bcdca08..1bd454a71b 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -2,7 +2,7 @@ name: go_router_builder description: >- A builder that supports generated strongly-typed route helpers for package:go_router -version: 2.2.3 +version: 2.2.4 repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22 @@ -23,5 +23,5 @@ dependencies: dev_dependencies: build_test: ^2.1.7 dart_style: 2.3.2 - go_router: ^9.0.0 + go_router: ^10.0.0 test: ^1.20.0 diff --git a/packages/go_router_builder/test_inputs/default_value.dart.expect b/packages/go_router_builder/test_inputs/default_value.dart.expect index 364970d3f1..af5ce08b34 100644 --- a/packages/go_router_builder/test_inputs/default_value.dart.expect +++ b/packages/go_router_builder/test_inputs/default_value.dart.expect @@ -6,7 +6,8 @@ RouteBase get $defaultValueRoute => GoRouteData.$route( extension $DefaultValueRouteExtension on DefaultValueRoute { static DefaultValueRoute _fromState(GoRouterState state) => DefaultValueRoute( param: - _$convertMapValue('param', state.queryParameters, int.parse) ?? 0, + _$convertMapValue('param', state.uri.queryParameters, int.parse) ?? + 0, ); String get location => GoRouteData.$location( diff --git a/packages/go_router_builder/test_inputs/extra_value.dart.expect b/packages/go_router_builder/test_inputs/extra_value.dart.expect index acf8c2b785..a3c02e4cbf 100644 --- a/packages/go_router_builder/test_inputs/extra_value.dart.expect +++ b/packages/go_router_builder/test_inputs/extra_value.dart.expect @@ -6,7 +6,8 @@ RouteBase get $extraValueRoute => GoRouteData.$route( extension $ExtraValueRouteExtension on ExtraValueRoute { static ExtraValueRoute _fromState(GoRouterState state) => ExtraValueRoute( param: - _$convertMapValue('param', state.queryParameters, int.parse) ?? 0, + _$convertMapValue('param', state.uri.queryParameters, int.parse) ?? + 0, $extra: state.extra as int?, ); diff --git a/packages/go_router_builder/test_inputs/iterable_with_default_value.dart.expect b/packages/go_router_builder/test_inputs/iterable_with_default_value.dart.expect index 4bcda17844..0b53e45b02 100644 --- a/packages/go_router_builder/test_inputs/iterable_with_default_value.dart.expect +++ b/packages/go_router_builder/test_inputs/iterable_with_default_value.dart.expect @@ -6,8 +6,8 @@ RouteBase get $iterableDefaultValueRoute => GoRouteData.$route( extension $IterableDefaultValueRouteExtension on IterableDefaultValueRoute { static IterableDefaultValueRoute _fromState(GoRouterState state) => IterableDefaultValueRoute( - param: - state.queryParametersAll['param']?.map(int.parse) ?? const [0], + param: state.uri.queryParametersAll['param']?.map(int.parse) ?? + const [0], ); String get location => GoRouteData.$location( diff --git a/packages/go_router_builder/test_inputs/iterable_with_enum.dart.expect b/packages/go_router_builder/test_inputs/iterable_with_enum.dart.expect index 2043156832..048909fbff 100644 --- a/packages/go_router_builder/test_inputs/iterable_with_enum.dart.expect +++ b/packages/go_router_builder/test_inputs/iterable_with_enum.dart.expect @@ -6,7 +6,7 @@ RouteBase get $iterableWithEnumRoute => GoRouteData.$route( extension $IterableWithEnumRouteExtension on IterableWithEnumRoute { static IterableWithEnumRoute _fromState(GoRouterState state) => IterableWithEnumRoute( - param: state.queryParametersAll['param'] + param: state.uri.queryParametersAll['param'] ?.map(_$EnumOnlyUsedInIterableEnumMap._$fromName), ); diff --git a/packages/go_router_builder/test_inputs/required_parameters_not_in_path_can_be_null.dart.expect b/packages/go_router_builder/test_inputs/required_parameters_not_in_path_can_be_null.dart.expect index eeaa458d24..0e27dc9e5f 100644 --- a/packages/go_router_builder/test_inputs/required_parameters_not_in_path_can_be_null.dart.expect +++ b/packages/go_router_builder/test_inputs/required_parameters_not_in_path_can_be_null.dart.expect @@ -7,7 +7,7 @@ extension $NullableRequiredParamNotInPathExtension on NullableRequiredParamNotInPath { static NullableRequiredParamNotInPath _fromState(GoRouterState state) => NullableRequiredParamNotInPath( - id: _$convertMapValue('id', state.queryParameters, int.parse), + id: _$convertMapValue('id', state.uri.queryParameters, int.parse), ); String get location => GoRouteData.$location( diff --git a/packages/go_router_builder/test_inputs/required_query_parameter.dart.expect b/packages/go_router_builder/test_inputs/required_query_parameter.dart.expect index 7034c49a79..09d957cb07 100644 --- a/packages/go_router_builder/test_inputs/required_query_parameter.dart.expect +++ b/packages/go_router_builder/test_inputs/required_query_parameter.dart.expect @@ -7,7 +7,7 @@ extension $NonNullableRequiredParamNotInPathExtension on NonNullableRequiredParamNotInPath { static NonNullableRequiredParamNotInPath _fromState(GoRouterState state) => NonNullableRequiredParamNotInPath( - id: int.parse(state.queryParameters['id']!), + id: int.parse(state.uri.queryParameters['id']!), ); String get location => GoRouteData.$location( diff --git a/packages/go_router_builder/tool/run_tests.dart b/packages/go_router_builder/tool/run_tests.dart index 39cdb4c756..edcc32ab15 100644 --- a/packages/go_router_builder/tool/run_tests.dart +++ b/packages/go_router_builder/tool/run_tests.dart @@ -56,6 +56,6 @@ Future main() async { .trim() .replaceAll('\r\n', '\n'); expect(generated, equals(expectResult.replaceAll('\r\n', '\n'))); - }); + }, timeout: const Timeout(Duration(seconds: 100))); } }