Translations class
Method B: Advanced
All widgets using this method will trigger a rebuild when locale changes. Use this if you have e.g. a settings page where the user can select the locale during runtime.
Step 1: wrap your App with TranslationProvider( child: MyApp() );
Step 2:
final t = Translations.of(context); // Get t variable.
String a = t.someKey.anotherKey; // Use t variable.
String b = t'someKey.anotherKey'
; // Only for edge cases!
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → _StringsEn