I'm facing an issue: when I'm on my profile screen and update my current locale, sometimes it doesn't update my home screen, that is 2 screens behind this current screen, it still on English ou if I change from English to Portuguese, it happens in the same way.
I'm using this to update the locale:
Locale locale = Locale('pt', 'BR');
context.locale = locale;
Someone already faced it?
That's my config:
main.dart
void main() => runApp(
EasyLocalization(
supportedLocales: [
Locale('en', 'US'),
Locale('pt', 'BR'),
],
path: 'assets/translations',
saveLocale: true,
fallbackLocale: Locale('en', 'US'),
child: ModularApp(module: AppModule()),
),
);
I'm facing the same issue, my work around is refresh the previous page after update the locale
Example:
Navigator.of(context).pushNamed(NaviConstant.changeLanguage).whenComplete(() => setState(() {}));
I'm facing the same issue, my work around is refresh the previous page after update the locale
Example:
Navigator.of(context).pushNamed(NaviConstant.changeLanguage).whenComplete(() => setState(() {}));
In my specific case, my home screen page is inside another screen with BottomNovigation. So to get back on that screen I have to Pop my current screen. I didn't know if I do this .whenComplete(() => setState(() {})); will resolve the problem, but I'll try this workaround. Thank you.
I'm using MobX, and my workaround for that was put an Observer wrapping the Scaffold on my main screen that has a BottomNavigationBar were all screen came from.
Having the same issue here on Flutter version 1.22.5
After updating the locale and pop to the previous page, the previous page locale is not updated.
hmm... need recheck this bug
@aissat
@Overman775 @alvindrakes @VictorCamargo @alfred-risb hi guys try this https://github.com/aissat/easy_localization/issues/292#issuecomment-742134521
Most helpful comment
In my specific case, my home screen page is inside another screen with BottomNovigation. So to get back on that screen I have to Pop my current screen. I didn't know if I do this
.whenComplete(() => setState(() {}));will resolve the problem, but I'll try this workaround. Thank you.