fixed splashscreen removal

This commit is contained in:
Vadim 2024-11-06 19:03:38 +01:00
parent fce8d0bb6a
commit c8eafd9e2c

View file

@ -51,6 +51,7 @@ class _ApplicationWrapperState extends State<ApplicationWrapper> {
void initState() { void initState() {
super.initState(); super.initState();
_initFuture = _initialize(); _initFuture = _initialize();
_removeSplashscreen();
} }
@override @override
@ -99,14 +100,20 @@ class _ApplicationWrapperState extends State<ApplicationWrapper> {
SharedPreferences.getInstance(), SharedPreferences.getInstance(),
const LightSensorService(LocalPlatform()).hasSensor(), const LightSensorService(LocalPlatform()).hasSensor(),
remoteConfigService.activeAndFetchFeatures(), remoteConfigService.activeAndFetchFeatures(),
equipmentProfilesStorageService.init(),
filmsStorageService.init(), filmsStorageService.init(),
]).then((value) { ]).then((value) {
userPreferencesService = UserPreferencesService((value[0] as SharedPreferences?)!); userPreferencesService = UserPreferencesService((value[0] as SharedPreferences?)!);
hasLightSensor = value[1] as bool? ?? false; hasLightSensor = value[1] as bool? ?? false;
}); });
await Future.wait([ }
void _removeSplashscreen() {
Future.wait([
equipmentProfilesStorageServiceCompleter.future, equipmentProfilesStorageServiceCompleter.future,
filmsStorageServiceCompleter.future, filmsStorageServiceCompleter.future,
]).then((_) => FlutterNativeSplash.remove()); ]).then((_) {
FlutterNativeSplash.remove();
});
} }
} }