ComponentStrings class
Translated Strings file
Constructors
- ComponentStrings(Locale locale, {bool debugStrings = false})
- Constructs a ComponentStrings. default value for debugStrings is false.
Properties
- debugStrings → bool
-
debug strings flag.
Default value of debugStrings is false.
If true then get method returns key instead of value
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale → Locale
-
Locale set to get translated strings of.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
String key, String fallback, {List< String> ? args}) → String -
Gets a translated string from
key
, otherwise usesfallback
. -
getAll(
) → Map< String, String> - Gets all translated strings
-
load(
) → Future< ComponentStrings> -
Loads strings from file and sets
_strings
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Map< String, String> delta) → void -
Update existing strings with
delta
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
delegate
↔ LocalizationsDelegate<
ComponentStrings> -
Delegate used to get the translated strings.
getter/setter pair
-
localizationsDelegates
↔ List<
LocalizationsDelegate> -
A list of this localizations delegate along with the default localizations
delegates.
getter/setter pair
Static Methods
-
of(
BuildContext context) → ComponentStrings -
Returns the localized resources object of the given
ComponentStrings
for the widget tree that corresponds to the givencontext
.
Constants
- defaultLocale → const Locale
-
Default locale of the components is English.
Locale('en')
-
supportedLocales
→ const List<
Locale> -
A list of this localizations delegate's supported locales.
<Locale>[Locale('ar'), Locale('bg'), Locale('bs'), Locale('cs'), Locale('de'), Locale('de', 'AT'), Locale('de', 'BE'), Loc…