Merge pull request 'splash_scren' (#156) from splash_scren into main

Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/156
This commit is contained in:
a.ghabeli
2025-09-23 13:38:01 +03:30
14 changed files with 263 additions and 12 deletions
+1
View File
@@ -4,6 +4,7 @@ class AssetsManager {
//logo
static const logoSmall = 'assets/icons/logo_small.svg';
static const logoBig = 'assets/icons/logo_big.svg';
static const logoBigPng = 'assets/pngs/logo-big.png';
//bottom navigation
static const homeActive = 'assets/icons/home_active.svg';
+13 -1
View File
@@ -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>>[
+28
View File
@@ -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,