TranslationFileReader class
Convenience for loading translation files from disk or asset bundles.
Constructors
-
TranslationFileReader({ConfigFileType fileType = ConfigFileType.YAML, required TFileReaderFunction? fileReader, required List<
String> translationsDirPath, dynamic mapper(TGetKeyAndDefaultValueResult textResult)?}) -
const
Properties
- fileReader → TFileReaderFunction?
-
A function to read a file. Typical implementations:
(filePath) => File(filePath).readAsString()on dart:io, or(filePath) => rootBundle.loadString(filePath)on Flutter.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)?
-
Optional hook for custom key resolution. See Config.mapper.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
translationsDirPath
→ List<
String> -
The directory path segments where the translation files live.
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 and registers it with the active TranslationManager. Returns the loaded FileConfig.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited