Switch the app language without restarting the page.
The shopping example reads the current locale from I18nScope.
The button picks en or my, then calls setLocale.
Widgets under the scope rebuild with the new locale.
MaterialApp uses the generated locale, supported locales, and delegates.
The same controller drives Dust text and Flutter's built-in localized widgets.
Docs used: switching locales and the shopping app language button.

Top comments (0)