LocalizationExt extension

Extends BuildContext to provide easy access to LocalizationManager methods.

This extension adds several convenience methods to any BuildContext, facilitating the management of localization actions directly from the context.

on

Properties

locale Locale

Available on BuildContext, provided by the LocalizationExt extension

Retrieves the current locale from the LocalizationProvider.
no setter
localizationsDelegates Iterable<LocalizationsDelegate>

Available on BuildContext, provided by the LocalizationExt extension

Returns a list of localization delegates including:
no setter
locManager LocalizationManager

Available on BuildContext, provided by the LocalizationExt extension

Retrieves the LocalizationManager from the nearest LocalizationProvider in the widget tree.
no setter
supportedLocales Iterable<Locale>

Available on BuildContext, provided by the LocalizationExt extension

Retrieves the list of supported locales by mapping them from the LocalizationProvider.
no setter

Methods

addTranslation(String name) → void

Available on BuildContext, provided by the LocalizationExt extension

Adds a translation resource by its name.
changeLocale(Locale newLocale) → void

Available on BuildContext, provided by the LocalizationExt extension

Changes the application's current locale.
reloadTranslation(String name) → void

Available on BuildContext, provided by the LocalizationExt extension

Reloads a specific translation by its name for the current locale.
reloadTranslations() → void

Available on BuildContext, provided by the LocalizationExt extension

Reloads all translations for the current context.
removeTranslation(String name) → void

Available on BuildContext, provided by the LocalizationExt extension

Removes a translation resource by its name.