-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[go_router_builder]Avoid losing NullabilitySuffix for typeArguments (#…
…5215) fixes flutter/flutter#135591 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
- Loading branch information
Showing
5 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/go_router_builder/test_inputs/required_nullable_type_arguments_extra_value.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:go_router/go_router.dart'; | ||
|
||
@TypedGoRoute<RequiredNullableTypeArgumentsExtraValueRoute>( | ||
path: '/default-value-route') | ||
class RequiredNullableTypeArgumentsExtraValueRoute extends GoRouteData { | ||
RequiredNullableTypeArgumentsExtraValueRoute({required this.$extra}); | ||
final List<int?> $extra; | ||
} |
30 changes: 30 additions & 0 deletions
30
...es/go_router_builder/test_inputs/required_nullable_type_arguments_extra_value.dart.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
RouteBase get $requiredNullableTypeArgumentsExtraValueRoute => | ||
GoRouteData.$route( | ||
path: '/default-value-route', | ||
factory: | ||
$RequiredNullableTypeArgumentsExtraValueRouteExtension._fromState, | ||
); | ||
|
||
extension $RequiredNullableTypeArgumentsExtraValueRouteExtension | ||
on RequiredNullableTypeArgumentsExtraValueRoute { | ||
static RequiredNullableTypeArgumentsExtraValueRoute _fromState( | ||
GoRouterState state) => | ||
RequiredNullableTypeArgumentsExtraValueRoute( | ||
$extra: state.extra as List<int?>, | ||
); | ||
|
||
String get location => GoRouteData.$location( | ||
'/default-value-route', | ||
); | ||
|
||
void go(BuildContext context) => context.go(location, extra: $extra); | ||
|
||
Future<T?> push<T>(BuildContext context) => | ||
context.push<T>(location, extra: $extra); | ||
|
||
void pushReplacement(BuildContext context) => | ||
context.pushReplacement(location, extra: $extra); | ||
|
||
void replace(BuildContext context) => | ||
context.replace(location, extra: $extra); | ||
} |