ParodiaHTTP constructor
ParodiaHTTP({})
Creates a new instance of ParodiaHTTP.
The parameters can be used to specify the initial values for the base URL, store key, authentication token, and currency.
Implementation
ParodiaHTTP({
required String baseUrl,
required String storeKey,
String? authToken,
String? currency,
}) {
_dio = Dio();
_baseUrl = baseUrl;
_storeKey = storeKey;
_authToken = authToken;
_currency = currency;
_headers["Store"] = _storeKey;
if (authToken != null) {
_headers["Authorization"] = "Bearer $_authToken";
}
if (currency != null) {
_headers["Currency"] = currency;
}
_options.baseUrl = _baseUrl;
_options.headers = _headers;
_dio!.options = _options;
}