Language bugfix + package upgrades + incr. ver.

This commit is contained in:
Imran Remtulla
2023-02-27 19:00:50 -05:00
parent 5f3eeb9971
commit ce526d8d26
5 changed files with 24 additions and 5 deletions

View File

@@ -178,4 +178,15 @@ class SettingsProvider with ChangeNotifier {
bool setEqual(Set<String> a, Set<String> b) =>
a.length == b.length && a.union(b).length == a.length;
void resetLocaleSafe(BuildContext context) {
if (context.supportedLocales
.map((e) => e.languageCode)
.contains(context.deviceLocale.languageCode)) {
context.resetLocale();
} else {
context.setLocale(context.fallbackLocale!);
context.deleteSaveLocale();
}
}
}