WebserviceHelper<T> constructor
WebserviceHelper<T> ({})
Implementation
WebserviceHelper({
required this.endPointType,
this.itemFromJson,
this.params,
this.queryParameters,
this.formData,
this.path,
this.onSendProgress,
this.onReceiveProgress,
this.cancelToken,
}) {
_dio = Dio(
BaseOptions(
baseUrl: endPointType.url,
receiveDataWhenStatusError: true,
headers: endPointType.headers,
connectTimeout: const Duration(seconds: 60),
receiveTimeout: const Duration(seconds: 60),
validateStatus: (statusCode) {
log('statusCode: $statusCode');
if (statusCode == null) {
return false;
}
return true;
},
),
);
}