Skip to content

Instantly share code, notes, and snippets.

@BrianMwas
Created July 31, 2021 20:26
Show Gist options
  • Save BrianMwas/3399c3a16efd1952df686590950a9fe5 to your computer and use it in GitHub Desktop.
Save BrianMwas/3399c3a16efd1952df686590950a9fe5 to your computer and use it in GitHub Desktop.
Getx main file with navigation management
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GetMaterialApp(
theme: ThemeData(
primarySwatch: Colors.blue,
),
initialRoute: AppLinks.LOGIN,
getPages: AppRoutes.pages,
);
}
}
class AppRoutes {
static final pages = [
GetPage(
name: AppLinks.LOGIN,
page: () => Login()
),
]
}
class AppLinks {
static const String LOGIN = "/login";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment