locale_switcher library
A widget for switching the locale of your application.
Classes
- LangIconWithToolTip
- Icon representing the language.
- LocaleManager
- This should be a parent to either MaterialApp or CupertinoApp.
- LocaleMatcher
- Helper, allow to find LocaleName in LocaleSwitcher.supportedLocaleNames.
- LocaleName
- Wrapper around Locale, it's name, flag, language and few helpers.
- LocaleSwitcher
- A Widget to switch locale of App.
- LocaleSwitcherState
- SupportedLocaleNames
- A list of generated LocaleNames for supportedLocales.
- TitleForLocaleSwitch
-
Just a little helper - title of the widget
LocaleSwitch
.
Enums
- FlagNotFoundFallBack
-
Parameter for
Locale.flag
extension. - IfLocaleNotFound
-
Parameter for LocaleMatcher.trySetLocale and
LocaleMatcher.tryfindLocale
. - LocaleSwitcherType
- Names of possible LocaleSwitcher constructors.
Extensions
- LocaleFlag on Locale
- StringToLocale on String
Constants
- showOtherLocales → const String
- A special name for wrapper LocaleName to use as button that show other locales.
- systemLocale → const String
- A special name for wrapper LocaleName to use as system locale option.
Functions
-
findFlagFor(
{String? language, String? country}) → Widget? - Try to found flag by language or country string.
-
showSelectLocaleDialog(
BuildContext context, {String title = 'Select language', double? width, double? height, SliverGridDelegate? gridDelegate, dynamic setLocaleCallBack(BuildContext)?}) → Future< void> - Show popup dialog to select Language.
Typedefs
- LocaleSwitchBuilder = Widget Function(SupportedLocaleNames, BuildContext)