config method
void
config({})
Override ExtendedHttp config
timeout -- Request timeout, default 60 seconds.
networkFirst -- If true, fetch data from network first,
then if failed, try get from cache. Versa if false.
Only work with GET requests, default true.
headers -- Custom request headers.
Implementation
void config({
Duration timeout = const Duration(seconds: 60),
bool networkFirst = true,
Map<String, String>? headers,
String? baseURL,
}) {
_networkFirst = networkFirst;
_timeout = timeout;
if (headers != null) {
_headers = headers;
}
if (baseURL != null) {
_baseURL = baseURL;
}
}