Skip to content

Instantly share code, notes, and snippets.

@vaygeth89
Created October 16, 2021 04:12
Show Gist options
  • Save vaygeth89/69ef10488b30b9051abf2e771a3d4391 to your computer and use it in GitHub Desktop.
Save vaygeth89/69ef10488b30b9051abf2e771a3d4391 to your computer and use it in GitHub Desktop.
class Routes {
static const String landingPageRoute = "/";
static const String signInPageRoute = "/sign-in";
static const String profilePageRoute = "/profile";
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case signInPageRoute:
{
return CupertinoPageRoute(
settings: settings,
title: signInPageRoute,
builder: (_) => SignInPage());
}
case profilePageRoute:
{
return CupertinoPageRoute(
settings: settings,
title: profilePageRoute,
builder: (_) => UserProfilePage());
}
case landingPageRoute:
default:
{
return CupertinoPageRoute(
settings: settings,
title: landingPageRoute,
builder: (_) => LandingPage());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment