|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
|
|
|
|
|
@ -30,16 +31,19 @@ class _SplashScreenState extends State<SplashScreen> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
AppGlobal.context = context;
|
|
|
|
|
super.initState();
|
|
|
|
|
Timer(
|
|
|
|
|
Duration(seconds: 1, milliseconds: 500),
|
|
|
|
|
() async {
|
|
|
|
|
await loadPrivilege().then((value) {
|
|
|
|
|
Navigator.of(context).pushReplacement(
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => LandingPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
if(!_privilegeService.hasError) {
|
|
|
|
|
Navigator.of(context).pushReplacement(
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => LandingPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else {}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
@ -58,10 +62,6 @@ class _SplashScreenState extends State<SplashScreen> {
|
|
|
|
|
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
|
|
|
|
|
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
|
|
|
|
|
PushNotificationHandler(context).init(); // Asyncronously
|
|
|
|
|
AppSharedPreferences().getAll().then((value) {
|
|
|
|
|
// debugPrint("ALL SHARED PREFERENCES!!!!!");
|
|
|
|
|
// debugPrint(jsonEncode(value));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|