| RouteBase get $iterableDefaultValueRoute => GoRouteData.$route( |
| path: '/iterable-default-value-route', |
| factory: $IterableDefaultValueRouteExtension._fromState, |
| ); |
| |
| extension $IterableDefaultValueRouteExtension on IterableDefaultValueRoute { |
| static IterableDefaultValueRoute _fromState(GoRouterState state) => |
| IterableDefaultValueRoute( |
| param: state.uri.queryParametersAll['param']?.map(int.parse) ?? |
| const <int>[0], |
| ); |
| |
| String get location => GoRouteData.$location( |
| '/iterable-default-value-route', |
| queryParams: { |
| if (param != const <int>[0]) |
| 'param': param.map((e) => e.toString()).toList(), |
| }, |
| ); |
| |
| void go(BuildContext context) => context.go(location); |
| |
| Future<T?> push<T>(BuildContext context) => context.push<T>(location); |
| |
| void pushReplacement(BuildContext context) => |
| context.pushReplacement(location); |
| |
| void replace(BuildContext context) => context.replace(location); |
| } |