TimetableLocalizationsDelegate class
Provides localized strings for Timetable widgets.
Supported Locale.languageCodes:
de– Germanen– Englishes– Spanishfr– Frenchhu– Hungarianit– Italianja– Japanesept– Portuguesezh_CN– Chinese (Simplified)zh_TW– Chinese (Traditional)
By default, this delegate also configures Intl whenever Flutter's locale
changes. This behavior can be disabled via setIntlLocale.
See also:
- TimetableLocalizations, which contains all strings for one locale.
Supporting a new locale
- Copy
TimetableLocalizationsEnfrom below, rename it (using the UpperCamelCase variant of its BCP 47 language tag), and update it to the new locale. The classes should be ordered alphabetically. - Add your class to the
_getLocalizationmethod below (again, ordered alphabetically). - List the new locale in the README (alphabetically).
- Add the new locale to the list above (alphabetically).
- Add the locale to
_supportedLocaleinexample/lib/utils.dart. - Open a pull request and you're done 🎉
- Inheritance
-
- Object
- LocalizationsDelegate<
TimetableLocalizations> - TimetableLocalizationsDelegate
Constructors
- TimetableLocalizationsDelegate({bool setIntlLocale = true, Locale? fallbackLocale})
-
const
Properties
- fallbackLocale → Locale?
-
When localizations for a requested locale are missing, Timetable will
instead use this locale.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setIntlLocale → bool
-
Whether to update
Intl.defaultLocalewhen the app's locale changes.final - type → Type
-
The type of the object returned by the load method, T by default.
no setterinherited
Methods
-
isSupported(
Locale locale) → bool -
Whether resources for the given locale can be loaded by this delegate.
override
-
load(
Locale locale) → Future< TimetableLocalizations> -
Start loading the resources for
locale. The returned future completes when the resources have finished loading.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldReload(
covariant TimetableLocalizationsDelegate old) → bool -
Returns true if the resources for this delegate should be loaded
again by calling the load method.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited