in nav2-usability/scenario_code/lib/sign-in-routing/router.dart [119:139]
Future<AppRoutePath> parseRouteInformation(
RouteInformation routeInformation) async {
final uri = Uri.parse(routeInformation.location!);
// Check if the user is signed in.
if (!await _appState.auth.isSignedIn()) {
return SignInRoutePath();
}
// Handle '/'
if (uri.pathSegments.isEmpty) {
return HomeRoutePath();
}
if (uri.pathSegments.length == 1 && uri.pathSegments[0] == 'books') {
return BooksRoutePath();
}
// Handle unknown routes
return HomeRoutePath();
}