handle method
Logic to decide if the navigation should be redirected. Returns a path to redirect to, or null to allow navigation.
Implementation
@override
FutureOr<String?> handle(BuildContext context, GoRouterState state) {
if (!isAuthenticated()) {
return loginPath;
}
return null;
}