BASE: Create AppRouter Util.
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:customer/screen_ui/service_home_screen/service_list_screen.dart'
|
||||
import 'package:customer/utils/notification_service.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../screen_ui/auth_screens/login_screen.dart';
|
||||
import '../screen_ui/location_enable_screens/location_permission_screen.dart';
|
||||
@@ -14,9 +15,13 @@ import '../screen_ui/on_boarding_screen/on_boarding_screen.dart';
|
||||
import '../service/fire_store_utils.dart';
|
||||
|
||||
class SplashController extends GetxController {
|
||||
final BuildContext context;
|
||||
|
||||
SplashController({required this.context});
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
Timer(const Duration(seconds: 3), () => redirectScreen());
|
||||
Timer(const Duration(seconds: 2), () => redirectScreen());
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@@ -73,4 +78,11 @@ class SplashController extends GetxController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _navigateAndRemoveAll(Widget screen) {
|
||||
Navigator.of(context).pushAndRemoveUntil(
|
||||
MaterialPageRoute(builder: (_) => screen),
|
||||
(route) => false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user