-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
flutter/packages
#2435Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
This is a proposal to change GoRouterRedirect to an asynchronous function.
typedef GoRouterRedirect = Future<String?> Function(GoRouterState state);This would allow a redirect to make asynchronous calls, for example to check if the user is signed in:
redirect: (state) async {
final signedIn = await _appState.auth.isSignedIn();
if (!signedIn) return '/signin';
return null;
},Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.