callBack method
Future<Response>
callBack(
- String url, {
- required NetworkDiocallback_dio callback,
- Map<
String, dynamic> ? body, - Map<
String, String> ? headers, - NetworkRequestFile? requestFile,
- ProgressCallbackFastor? onSendProgress,
- ProgressCallbackFastor? onReceiveProgress,
- NetworkTypeDio? type,
- bool? isEnableLogDioPretty,
- int? timeOutSecond,
- bool? handleErrorXMLHttpRequest,
Implementation
Future<Response> callBack(String url,
{ required NetworkDiocallback_dio callback,
Map<String, dynamic>? body,
Map<String, String>? headers,
///file
NetworkRequestFile? requestFile,
ProgressCallbackFastor? onSendProgress,
ProgressCallbackFastor? onReceiveProgress,
///other
NetworkTypeDio? type,
bool? isEnableLogDioPretty ,
int? timeOutSecond,
bool? handleErrorXMLHttpRequest
}) async {
//set values
this.url = url;
this.type = type;
this.requestFile = requestFile;
this.timeOutSecond = timeOutSecond;
// handler error
handleErrorXMLHttpRequest ??= false;
this.handleErrorXMLHttpRequest = handleErrorXMLHttpRequest;
//log
isEnableLogDioPretty ??= true ; //default take test enviroment
this.isEnableLogDioPretty = isEnableLogDioPretty;
//set body and header
if (body != null) this.body = body;
if (headers != null) this.headers = headers;
//edit headers
this.headers = setDefaultHeader(headers);
_setupNetworkTypeDefault();
this.callback_dio = callback;
_configureSetup();
return await _chooseTypeNetworkThenStartService( onSendProgress: onSendProgress, onReceiveProgress: onReceiveProgress);
}