|
|
|
@ -29,7 +29,9 @@ class BaseAppClient {
|
|
|
|
required Function(String error, int statusCode) onFailure,
|
|
|
|
required Function(String error, int statusCode) onFailure,
|
|
|
|
bool isAllowAny = false,
|
|
|
|
bool isAllowAny = false,
|
|
|
|
bool isLiveCare = false,
|
|
|
|
bool isLiveCare = false,
|
|
|
|
bool isFallLanguage = false}) async {
|
|
|
|
bool isFallLanguage = false,
|
|
|
|
|
|
|
|
bool isCustomRequest = false
|
|
|
|
|
|
|
|
}) async {
|
|
|
|
String url;
|
|
|
|
String url;
|
|
|
|
if (isLiveCare)
|
|
|
|
if (isLiveCare)
|
|
|
|
url = BASE_URL_LIVE_CARE + endPoint;
|
|
|
|
url = BASE_URL_LIVE_CARE + endPoint;
|
|
|
|
@ -40,7 +42,7 @@ class BaseAppClient {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
String? token = await sharedPref.getString(TOKEN);
|
|
|
|
String? token = await sharedPref.getString(TOKEN);
|
|
|
|
|
|
|
|
if(!isCustomRequest) {
|
|
|
|
if (profile != null) {
|
|
|
|
if (profile != null) {
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
if (body == null || body['DoctorID'] == null) {
|
|
|
|
if (body == null || body['DoctorID'] == null) {
|
|
|
|
@ -115,9 +117,10 @@ class BaseAppClient {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
body['DeviceTypeID'] = Platform.isAndroid ? '1' : '2';
|
|
|
|
body['DeviceTypeID'] = Platform.isAndroid ? '1' : '2';
|
|
|
|
if( body['SetupID'] != null) {
|
|
|
|
if (body['SetupID'] != null) {
|
|
|
|
body['SetupID'] = body['SetupID'].trim();
|
|
|
|
body['SetupID'] = body['SetupID'].trim();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
// body['ClinicID'] = 501;
|
|
|
|
// body['ClinicID'] = 501;
|
|
|
|
// body['ProjectID'] = 12;
|
|
|
|
// body['ProjectID'] = 12;
|
|
|
|
|
|
|
|
|
|
|
|
@ -134,7 +137,7 @@ class BaseAppClient {
|
|
|
|
final response = await http.post(Uri.parse(url), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'});
|
|
|
|
final response = await http.post(Uri.parse(url), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'});
|
|
|
|
final int statusCode = response.statusCode;
|
|
|
|
final int statusCode = response.statusCode;
|
|
|
|
|
|
|
|
|
|
|
|
if (body['DoctorID'] != null) {
|
|
|
|
if (body!['DoctorID'] != null) {
|
|
|
|
postRequestAndResponse(
|
|
|
|
postRequestAndResponse(
|
|
|
|
doctorId: body['DoctorID'],
|
|
|
|
doctorId: body['DoctorID'],
|
|
|
|
completeUrl: url,
|
|
|
|
completeUrl: url,
|
|
|
|
|