getDio method
Dio
getDio({})
if you want to return debug mode of dio which will include prettyfy display of the request sent via http or receive else it will not print the request use strictly on debugging mode
Implementation
Dio getDio(
{bool isDebug = false,
int maxWidth = 128,
bool requestBody = true,
bool requestHeader = true,
bool request = true,
bool error = true,
bool responseBody = true,
String cert = ""}) {
Dio dio = Dio();
dio.options.contentType = Headers.jsonContentType;
if (isDebug) {
dio.interceptors.add(
PrettyDioLogger(
requestBody: requestBody,
requestHeader: requestHeader,
request: request,
maxWidth: maxWidth,
error: error,
responseBody: responseBody),
);
return dio;
}
return Dio();
}