-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: go_router_builderThe go_router_builder packageThe go_router_builder packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
After go_router
6.5.0, we can use push method with returning value.
// extensions.dart
Future<T?> push<T extends Object?>(String location, {Object? extra}) =>
GoRouter.of(this).push<T>(location, extra: extra);
But go_router_builder
seems like it hasn't been applied.
// generated.g.dart
void push(BuildContext context) => context.push(location, extra: $extra);
Use case
want to use like this.
// use case
ExampleRoute().push().then((value) => print(value));
Proposal
I think it would work if created like this.
// generated.g.dart
Future<T?> push<T extends Object?>(BuildContext context) =>
context.push(location, extra: $extra);
vlazdra
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: go_router_builderThe go_router_builder packageThe go_router_builder packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version