mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
fixed splashscreen removal
This commit is contained in:
parent
fce8d0bb6a
commit
c8eafd9e2c
1 changed files with 9 additions and 2 deletions
|
@ -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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue