ApiCountryDataSource class

API-based country data source Fetches country data from a remote endpoint

Implemented types

Constructors

ApiCountryDataSource({required String apiUrl, Duration timeout = const Duration(seconds: 10), Map<String, String>? headers})

Properties

apiUrl String
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
final

Methods

fetchCountries() Future<Map<String, Country>?>
Fetch country data from the source Returns null if fetch fails (silent fallback)
override
isAvailable() Future<bool>
Optional: Check if source is available/reachable
override
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