router property
final
Implementation
static final GoRouter router = GoRouter(
navigatorKey: navigatorKey,
initialLocation: AppRoutes.splash,
routes: [
GoRoute(
name: AppRoutes.splash,
path: AppRoutes.splash,
builder: (context, state) => SplashView(),
),
GoRoute(
name: AppRoutes.login,
path: AppRoutes.login,
builder: (context, state) => LoginView(),
),
GoRoute(
name: AppRoutes.home,
path: AppRoutes.home,
builder: (context, state) {
var doctor = state.extra as Doctor?;
return Home(doctor: doctor);
}),
GoRoute(
name: AppRoutes.initProfileUpdate,
path: AppRoutes.initProfileUpdate,
builder: (context, state) {
var doctor = state.extra as Doctor;
return InitialProfileUpdate(
doctor: doctor,
);
}),
GoRoute(
name: AppRoutes.initProfileUpdate2,
path: AppRoutes.initProfileUpdate2,
builder: (context, state) {
var doctor = state.extra as Doctor;
return InitialProfileUpdate2(
doctor: doctor,
);
}),
],
errorBuilder: (context, state) => const Scaffold(
body: Center(child: Text('Page not found')),
),
);