import 'dart:async'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'config/shared_pref_kay.dart'; import 'config/size_config.dart'; import 'core/service/AuthenticatedUserObject.dart'; import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; import 'models/Authentication/authenticated_user.dart'; AppSharedPreferences sharedPref = new AppSharedPreferences(); AuthenticatedUserObject authenticatedUserObject = locator(); class SplashScreen extends StatefulWidget { @override _SplashScreenState createState() => _SplashScreenState(); } class _SplashScreenState extends State { //Provider.of(context, listen: false).isLogin @override void initState() { super.initState(); Timer( Duration(seconds: 1, milliseconds: 500), () { Provider.of(context, listen: false).loadSharedPrefLanguage().then((value) { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) => LandingPage(), ), ); }); }, ); } Future getUserData() async { Provider.of(context, listen: false).loadSharedPrefLanguage(); } @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: MediaQuery.of(context).size.height * 0.35,), Padding( padding: const EdgeInsets.all(25.0), child: Image.asset('assets/images/DQ/DQ_logo.png'), ), SizedBox(height: MediaQuery.of(context).size.height * 0.30,), Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Text(TranslationBase.of(context).poweredBy), Image.asset( 'assets/images/cs_logo_container.png', width: 80, ) ], ) ], ), ); } }