Translator class abstract

An abstract class representing a translator.

This class is intended to be extended to provide translation data for different locales.

Subclasses should implement the message method to return a map of translations.

Example:

class MyTranslator extends Translator {
  @override
  Map<String, Map<String, String>> message() {
    return {
      'en': {'hello': 'Hello'},
      'km': {'hello': 'សួស្តី'},
    };
  }
}

Constructors

Translator()

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

message() Map<String, Map<String, String>>
Returns a map of translations for different locales.
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