|
|
|
@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
Helpers helpers = new Helpers();
|
|
|
|
Helpers helpers = new Helpers();
|
|
|
|
@ -90,12 +91,6 @@ class BaseAppClient {
|
|
|
|
if (statusCode < 200 || statusCode >= 400) {
|
|
|
|
if (statusCode < 200 || statusCode >= 400) {
|
|
|
|
onFailure(Helpers.generateContactAdminMsg(), statusCode);
|
|
|
|
onFailure(Helpers.generateContactAdminMsg(), statusCode);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if(callLog){
|
|
|
|
|
|
|
|
callLog = false;
|
|
|
|
|
|
|
|
await AuthenticationViewModel().logout(isSessionTimeout: true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var parsed = json.decode(response.body.toString());
|
|
|
|
var parsed = json.decode(response.body.toString());
|
|
|
|
if (parsed['ErrorType'] == 4) {
|
|
|
|
if (parsed['ErrorType'] == 4) {
|
|
|
|
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
|
|
|
|
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
|
|
|
|
@ -106,7 +101,7 @@ class BaseAppClient {
|
|
|
|
if (body['OTP_SendType'] != null) {
|
|
|
|
if (body['OTP_SendType'] != null) {
|
|
|
|
onFailure(getError(parsed), statusCode);
|
|
|
|
onFailure(getError(parsed), statusCode);
|
|
|
|
} else if (!isAllowAny) {
|
|
|
|
} else if (!isAllowAny) {
|
|
|
|
await AuthenticationViewModel().logout(isSessionTimeout: true);
|
|
|
|
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).logout(isSessionTimeout: true);
|
|
|
|
Helpers.showErrorToast('Your session expired Please login again');
|
|
|
|
Helpers.showErrorToast('Your session expired Please login again');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isAllowAny) {
|
|
|
|
if (isAllowAny) {
|
|
|
|
|