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 L = Translations.of(context); // Get L variable.
String a = L.someKey.anotherKey; // Use L variable.
String b = L'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