listen to locale changes while app is running and update accordingly

This commit is contained in:
julian 2023-06-16 17:11:11 -06:00
parent 346a6a7a01
commit cfd73be0c3

View file

@ -463,6 +463,12 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
super.dispose();
}
@override
void didChangeLocales(List<Locale>? locales) {
ref.read(localeServiceChangeNotifierProvider).loadLocale();
super.didChangeLocales(locales);
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) async {
debugPrint("didChangeAppLifecycleState: ${state.name}");