added splash screen
This commit is contained in:
@@ -12,6 +12,7 @@ import '../../views/final_completion_of_documents/pages/final_completion_of_docu
|
||||
import '../../views/forgot_password/pages/forgot_password_screen.dart';
|
||||
import '../../views/notification/pages/notification_screen.dart';
|
||||
import '../../views/profile/pages/profile_screen.dart';
|
||||
import '../../views/splash/pages/splash_screen.dart';
|
||||
import '../../views/tenders/pages/tenders_screen.dart';
|
||||
import '../../views/your_tenders/pages/your_tenders_screen.dart';
|
||||
import 'app_shell/app_shell_screen.dart';
|
||||
@@ -31,7 +32,7 @@ final GlobalKey<NavigatorState> notificationNavigatorKey =
|
||||
// Main app router
|
||||
final GoRouter appRouter = GoRouter(
|
||||
routes: $appRoutes,
|
||||
initialLocation: '/login',
|
||||
initialLocation: '/splash',
|
||||
navigatorKey: rootNavigatorKey,
|
||||
);
|
||||
|
||||
@@ -46,6 +47,17 @@ class LoginScreenRoute extends GoRouteData with _$LoginScreenRoute {
|
||||
}
|
||||
}
|
||||
|
||||
// splash route - outside the shell
|
||||
@TypedGoRoute<SplashScreenRoute>(path: '/splash')
|
||||
class SplashScreenRoute extends GoRouteData with _$SplashScreenRoute {
|
||||
const SplashScreenRoute();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, GoRouterState state) {
|
||||
return const SplashScreen();
|
||||
}
|
||||
}
|
||||
|
||||
// Shell route with bottom navigation using StatefulShellRoute.indexedStack
|
||||
@TypedStatefulShellRoute<AppShellRouteData>(
|
||||
branches: <TypedStatefulShellBranch<StatefulShellBranchData>>[
|
||||
|
||||
@@ -8,6 +8,7 @@ part of 'app_routes.dart';
|
||||
|
||||
List<RouteBase> get $appRoutes => [
|
||||
$loginScreenRoute,
|
||||
$splashScreenRoute,
|
||||
$appShellRouteData,
|
||||
$yourTendersRouteData,
|
||||
$finalCompletionOfDocumentsRouteData,
|
||||
@@ -43,6 +44,33 @@ mixin _$LoginScreenRoute on GoRouteData {
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
RouteBase get $splashScreenRoute => GoRouteData.$route(
|
||||
path: '/splash',
|
||||
|
||||
factory: _$SplashScreenRoute._fromState,
|
||||
);
|
||||
|
||||
mixin _$SplashScreenRoute on GoRouteData {
|
||||
static SplashScreenRoute _fromState(GoRouterState state) =>
|
||||
const SplashScreenRoute();
|
||||
|
||||
@override
|
||||
String get location => GoRouteData.$location('/splash');
|
||||
|
||||
@override
|
||||
void go(BuildContext context) => context.go(location);
|
||||
|
||||
@override
|
||||
Future<T?> push<T>(BuildContext context) => context.push<T>(location);
|
||||
|
||||
@override
|
||||
void pushReplacement(BuildContext context) =>
|
||||
context.pushReplacement(location);
|
||||
|
||||
@override
|
||||
void replace(BuildContext context) => context.replace(location);
|
||||
}
|
||||
|
||||
RouteBase get $appShellRouteData => StatefulShellRouteData.$route(
|
||||
parentNavigatorKey: AppShellRouteData.$parentNavigatorKey,
|
||||
factory: $AppShellRouteDataExtension._fromState,
|
||||
|
||||
Reference in New Issue
Block a user