MatexCountryDataProvider class
A class that provides data related to countries by extending MatexDataProvider for MatexCountryMetadata.
It supports fetching data from a provided JSON string or from the default asset path.
- Inheritance
-
- Object
- MatexDataProvider<
MatexCountryMetadata> - MatexCountryDataProvider
Constructors
- MatexCountryDataProvider({String? jsonData})
- Creates an instance of MatexCountryDataProvider.
Properties
- debugLabel → String
-
Debug label for this data provider.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
jsonCache
↔ TCacheManager<
Map< String, dynamic> > -
Cache manager for raw JSON data.
latefinalinherited
- jsonData → String?
-
An optional JSON string representing country data. If this is provided,
the provider will use it directly instead of fetching from the asset.
final
-
modelCache
↔ TCacheManager<
MatexCountryMetadata> -
Cache manager for the parsed model.
latefinalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- ttl → Duration
-
Time to live duration for cached data.
finalinherited
Methods
-
dispose(
) → void -
Dispose both the model and JSON cache managers.
inherited
-
fetchData(
) → Future< String> -
Fetches country data.
override
-
findOne(
{required bool filter(MatexCountryMetadata)}) → Future< MatexCountryMetadata?> -
Retrieves a single model of type T that satisfies the given filter.
inherited
-
get(
String key) → Future< MatexCountryMetadata?> -
Get the model of type T corresponding to the provided key.
inherited
-
list(
) → Future< List< MatexCountryMetadata> > -
Get all the models of type T.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String key, Map< String, dynamic> jsonData) → MatexCountryMetadata -
Parses the provided JSON data to return a MatexCountryMetadata object.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited