feat: implement a new splash screen with custom branding, assets, and routing for both Android and iOS.
This commit is contained in:
@@ -20,6 +20,7 @@ import 'package:real_estate_mobile/features/profile/presentation/screens/profile
|
||||
import 'package:real_estate_mobile/features/notifications/presentation/screens/notifications_screen.dart';
|
||||
import 'package:real_estate_mobile/features/agents/presentation/screens/agent_edit_profile_screen.dart';
|
||||
import 'package:real_estate_mobile/features/profile/presentation/screens/payment_success_screen.dart';
|
||||
import 'package:real_estate_mobile/features/splash/presentation/screens/splash_screen.dart';
|
||||
|
||||
final routerProvider = Provider<GoRouter>((ref) {
|
||||
final authRefreshNotifier = _AuthRefreshNotifier();
|
||||
@@ -37,7 +38,7 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
const authRoutes = ['/login', '/signup'];
|
||||
|
||||
return GoRouter(
|
||||
initialLocation: '/home',
|
||||
initialLocation: '/splash',
|
||||
refreshListenable: authRefreshNotifier,
|
||||
redirect: (context, state) {
|
||||
final authState = ref.read(authProvider);
|
||||
@@ -50,6 +51,9 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
(route) => location == route || location.startsWith('$route/'),
|
||||
);
|
||||
|
||||
// Never redirect away from splash — it handles its own navigation
|
||||
if (location == '/splash') return null;
|
||||
|
||||
// While checking auth status, don't redirect
|
||||
if (isLoading) return null;
|
||||
|
||||
@@ -65,6 +69,12 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
return null;
|
||||
},
|
||||
routes: [
|
||||
// Splash screen (full screen, no shell)
|
||||
GoRoute(
|
||||
path: '/splash',
|
||||
builder: (context, state) => const SplashScreen(),
|
||||
),
|
||||
|
||||
// Auth routes (no shell — full screen)
|
||||
GoRoute(
|
||||
path: '/login',
|
||||
|
||||
Reference in New Issue
Block a user