TranslationFileReader class
Provides a way to easily read translation files.
Constructors
-
TranslationFileReader({ConfigFileType fileType = ConfigFileType.YAML, required TFileReaderFunction? fileReader, required List<
String> translationsDirPath, dynamic mapper(TGetKeyAndDefaultValueResult textResult)?}) -
const
- TranslationFileReader.withDefaultAssetsPackagePath({TFileReaderFunction? fileReader, ConfigFileType fileType = ConfigFileType.YAML, dynamic mapper(TGetKeyAndDefaultValueResult textResult)?})
-
const
Properties
- fileReader → TFileReaderFunction?
-
A function to read a file, such as
(filePath) => File(filePath).readAsString()or(filePath) => rootBundle.loadString(filePath).final - fileType → ConfigFileType
-
The type of the files to read.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- mapper → dynamic Function(TGetKeyAndDefaultValueResult textResult)?
-
Specify to manually map the translation keys.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
translationsDirPath
→ List<
String> -
The directory path where the translations are stored.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String languageTag, {String? fileName, TFileReaderFunction? fileReader}) → Future< FileConfig> - Reads a locale file.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited