Skip to content

setLocale() or context.locale=Locale("...") is not Updating app locale instantly #370

@red-star25

Description

@red-star25

I've updated easy_localization: 3.0.0 package from easy_localization: ^2.3.3.
When i was using easy_localization: ^2.3.3 it is updating my app locale instantly whenever i called

setState(() {
   context.locale = Locale("en");
});

But since I've updated the package version to 3.0.0 it is not updating the locale instantly. I've to hot restart the whole app to see the changes.

Here is what im doing in version 3.0.0

onTap: () async { await homeController .setLanguage("EN") .then((value) async { await context .setLocale( const Locale( "en")); }) },

And here is what im doing in version 2.3.3 (which is working,and updating locale instantly)
onTap: () { homeController .setLanguage("EN"); setState(() { context.locale = const Locale( "en"); }); },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions