-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/packages
#3368Labels
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 capabilityp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
Use case
With Navigator, we can push to new screen and await result.
final result = await Navigator.push(
context,
// Create the SelectionScreen in the next step.
MaterialPageRoute(builder: (context) => const SelectionScreen()),
);
Currently go_router is support push, go but it return void.
/// Navigate to a URI location w/ optional query parameters, e.g.
/// `/family/f2/person/p1?color=blue`
void go(String location, {Object? extra}) =>
routerDelegate.go(location, extra: extra);
/// Push a URI location onto the page stack w/ optional query parameters, e.g.
/// `/family/f2/person/p1?color=blue`
void push(String location, {Object? extra}) =>
routerDelegate.push(location, extra: extra);
Expected Behaviour: push, go support return a Future and user can call pop with a result.
This is sample for this feature:
Zazo032, theweiweiway, daniloapr, PcolBP, LostAnt and 109 morethibaultzanini, qflbai, AristideVB, omar-hanafy and christofkost
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 capabilityp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.