MessageSourceLoader class abstract
Interface for loading messages from different resource formats.
This abstraction allows the MessageSource system to support multiple file formats (JSON, YAML, Properties) through pluggable loaders. Each loader is responsible for parsing its specific format and returning a flat map of message keys to values.
Example implementation:
class JsonMessageLoader implements MessageSourceLoader {
@override
Future<Map<String, String>> load(AssetPathResource resource) async {
final parser = JsonParser();
final data = parser.parse(resource.getContentAsString());
return _flattenMap(data);
}
}
Constructors
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
-
flattenMap(
Map< String, dynamic> nested, {String prefix = ''}) → Map<String, String> - Flattens a nested map into dot-notation keys.
-
load(
AssetPathResource resource) → Future< Map< String, String> > - Load messages from the given resource.
-
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