added user page, pimpinan page, e signature
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../../../app/app.logger.dart';
|
||||
import '../../../app/app.router.dart';
|
||||
import '../../../app/core/custom_base_view_model.dart';
|
||||
@ -7,8 +9,29 @@ class SplashScreenViewModel extends CustomBaseViewModel {
|
||||
Future<void> init() async {
|
||||
// wait 2 seconds then navigate to login
|
||||
await Future.delayed(const Duration(seconds: 2));
|
||||
await navigationService.navigateTo(
|
||||
Routes.loginScreenView,
|
||||
);
|
||||
prefs.then((SharedPreferences prefs) {
|
||||
if (prefs.getBool('isLogin') != true) {
|
||||
return navigationService.navigateTo(
|
||||
Routes.userIndexTrackingView,
|
||||
);
|
||||
}
|
||||
|
||||
if (prefs.getString('role') == 'admin') {
|
||||
return navigationService.navigateTo(
|
||||
Routes.adminIndexTrackingView,
|
||||
);
|
||||
}
|
||||
|
||||
if (prefs.getString('role') == 'pimpinan') {
|
||||
return navigationService.navigateTo(
|
||||
Routes.pimpinanIndexTrackingView,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// await navigationService.navigateTo(
|
||||
// // Routes.loginScreenView,
|
||||
// Routes.userIndexTrackingView,
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user