NyLocalization class
NyLocalization Singleton object that handles localization in Nylo
Properties
-
delegates
→ Iterable<
LocalizationsDelegate> -
Returns app delegates.
used in app entry point e.g. MaterialApp()
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- languageCode → String
-
Returns language code as string
no setter
- locale → Locale
-
Returns locale code as Locale
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
init(
{LocaleType localeType = LocaleType.asDefined, required String languageCode, String assetsDirectory = 'lang/'}) → Future< void> - init NyLocalization
-
isDirectionRTL(
BuildContext context) → bool -
isDirectionRTL(BuildContext context)
returns
true
if active language direction is TRL -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restart(
BuildContext context) → void - reloads the app
-
setLanguage(
BuildContext context, {required String language, bool restart = true}) → Future< void> - changes active language
-
setLocale(
{required Locale locale}) → Future< void> - changes locale
-
toString(
) → String -
A string representation of this object.
inherited
-
translate(
String key, [Map< String, String> ? arguments]) → String - translates a word
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → NyLocalization
-
final