|
|
|
@ -11,7 +11,7 @@ class BaseAppClient {
|
|
|
|
|
|
|
|
|
|
|
|
url = BASE_URL + endPoint;
|
|
|
|
url = BASE_URL + endPoint;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
log("URL : $url");
|
|
|
|
log("URL : $url");
|
|
|
|
log("Body : ${json.encode(body)}");
|
|
|
|
log("Body : ${json.encode(body)}");
|
|
|
|
if (await Utils.checkConnection()) {
|
|
|
|
if (await Utils.checkConnection()) {
|
|
|
|
@ -36,11 +36,11 @@ class BaseAppClient {
|
|
|
|
onFailure('Please Check The Internet Connection', -1);
|
|
|
|
onFailure('Please Check The Internet Connection', -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
// } catch (e) {
|
|
|
|
if (onFailure != null) {
|
|
|
|
// if (onFailure != null) {
|
|
|
|
onFailure(e.toString(), -1);
|
|
|
|
// onFailure(e.toString(), -1);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static get(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
|
|
|
|
static get(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
|
|
|
|
|