Исправлено переключение локали на экране сканера
This commit is contained in:
@@ -38,24 +38,43 @@ class _SplashScreenState extends BaseState<SplashScreen> {
|
||||
}
|
||||
|
||||
void onStart() {
|
||||
helper.getSettings().then((info) {
|
||||
if (info == null) {
|
||||
platform.invokeMethod('getCurrency').then((currency) {
|
||||
platform.invokeMethod('getLocale').then((locale) {
|
||||
initLocale(locale, () {
|
||||
helper.createAppInfo(locale, currency).then((_) {
|
||||
showNext();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
helper.getLocale().then((locale) {
|
||||
if (locale == null) {
|
||||
initWithSystemValue();
|
||||
} else {
|
||||
helper.getLocale().then((locale) {
|
||||
initWithSavedValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void initWithSystemValue() {
|
||||
platform.invokeMethod('getLocale').then((locale) {
|
||||
helper.getSettings().then((settings) {
|
||||
if (settings == null) {
|
||||
createSettingsTable(locale);
|
||||
} else {
|
||||
initLocale(locale, () {
|
||||
showNext();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void initWithSavedValue() {
|
||||
helper.getLocale().then((locale) {
|
||||
initLocale(locale, () {
|
||||
showNext();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void createSettingsTable(String locale) {
|
||||
platform.invokeMethod('getCurrency').then((currency) {
|
||||
helper.createAppInfo(locale, currency);
|
||||
initLocale(locale, () {
|
||||
showNext();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user