Translate class

A class for handling translations in a Flutter application using JSON files. This class loads language files and returns translations based on the current locale.

Constructors

Translate.new(String key)
Constructs a Translate object with the specified translation key.

Properties

hashCode int
The hash code for this object.
no setterinherited
key String
The key for the specific translation being accessed.
getter/setter pair
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
Returns the translation for the given key as a string.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

isDefaultLang bool
Indicates if the default language is being used.
getter/setter pair
json Map<String, dynamic>
The map containing all loaded translations.
getter/setter pair

Static Methods

init({required String defaultLangCode, String? path, bool? isDebug}) Future<void>
Initializes the translation system with the specified default language code.