|
|
|
@ -1,5 +1,6 @@
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
|
|
|
|
@ -15,18 +16,19 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
|
|
|
|
|
|
|
|
bool get isFinished => _isFinished;
|
|
|
|
bool get isFinished => _isFinished;
|
|
|
|
|
|
|
|
|
|
|
|
setFinished(bool isFinished){
|
|
|
|
setFinished(bool isFinished) {
|
|
|
|
_isFinished = isFinished;
|
|
|
|
_isFinished = isFinished;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var endCallResponse = {};
|
|
|
|
var endCallResponse = {};
|
|
|
|
var transferToAdminResponse = {};
|
|
|
|
var transferToAdminResponse = {};
|
|
|
|
|
|
|
|
var isLoginResponse = {};
|
|
|
|
|
|
|
|
|
|
|
|
StartCallRes _startCallRes;
|
|
|
|
StartCallRes _startCallRes;
|
|
|
|
StartCallRes get startCallRes => _startCallRes;
|
|
|
|
StartCallRes get startCallRes => _startCallRes;
|
|
|
|
|
|
|
|
|
|
|
|
Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{
|
|
|
|
Future getPendingPatientERForDoctorApp(
|
|
|
|
|
|
|
|
PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
await baseAppClient.post(
|
|
|
|
await baseAppClient.post(
|
|
|
|
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
|
|
|
|
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
|
|
|
|
@ -47,58 +49,57 @@ class LiveCarePatientServices extends BaseService {
|
|
|
|
Future endCall(EndCallReq endCallReq) async {
|
|
|
|
Future endCall(EndCallReq endCallReq) async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async {
|
|
|
|
await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async {
|
|
|
|
|
|
|
|
|
|
|
|
endCallResponse = response;
|
|
|
|
endCallResponse = response;
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
|
|
|
|
|
|
|
hasError = true;
|
|
|
|
hasError = true;
|
|
|
|
super.error = error;
|
|
|
|
super.error = error;
|
|
|
|
}, body: endCallReq.toJson(),isLiveCare: true);
|
|
|
|
}, body: endCallReq.toJson(), isLiveCare: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future startCall(StartCallReq startCallReq) async {
|
|
|
|
Future startCall(StartCallReq startCallReq) async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
await baseAppClient.post(START_LIVE_CARE_CALL,
|
|
|
|
await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async {
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
_startCallRes = StartCallRes.fromJson(response);
|
|
|
|
_startCallRes = StartCallRes.fromJson(response);
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
hasError = true;
|
|
|
|
hasError = true;
|
|
|
|
super.error = error;
|
|
|
|
super.error = error;
|
|
|
|
}, body: startCallReq.toJson(),isLiveCare: true);
|
|
|
|
}, body: startCallReq.toJson(), isLiveCare: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Future endCallWithCharge(int vcID) async{
|
|
|
|
|
|
|
|
|
|
|
|
Future endCallWithCharge(int vcID) async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
await baseAppClient.post(
|
|
|
|
await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) {
|
|
|
|
END_CALL_WITH_CHARGE,
|
|
|
|
endCallResponse = response;
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
endCallResponse = response;
|
|
|
|
hasError = true;
|
|
|
|
},
|
|
|
|
super.error = error;
|
|
|
|
onFailure: (String error, int statusCode) {
|
|
|
|
}, body: {
|
|
|
|
hasError = true;
|
|
|
|
"VC_ID": vcID,
|
|
|
|
super.error = error;
|
|
|
|
"generalid": "Cs2020@2016\$2958",
|
|
|
|
},
|
|
|
|
}, isLiveCare: true);
|
|
|
|
body: {
|
|
|
|
|
|
|
|
"VC_ID": vcID,"generalid":"Cs2020@2016\$2958",
|
|
|
|
|
|
|
|
},isLiveCare: true
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future transferToAdmin(int vcID, String notes) async{
|
|
|
|
Future transferToAdmin(int vcID, String notes) async {
|
|
|
|
hasError = false;
|
|
|
|
hasError = false;
|
|
|
|
await baseAppClient.post(
|
|
|
|
await baseAppClient.post(TRANSFERT_TO_ADMIN, onSuccess: (dynamic response, int statusCode) {
|
|
|
|
TRANSFERT_TO_ADMIN,
|
|
|
|
transferToAdminResponse = response;
|
|
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
transferToAdminResponse = response;
|
|
|
|
hasError = true;
|
|
|
|
},
|
|
|
|
super.error = error;
|
|
|
|
onFailure: (String error, int statusCode) {
|
|
|
|
}, body: {
|
|
|
|
hasError = true;
|
|
|
|
"VC_ID": vcID,
|
|
|
|
super.error = error;
|
|
|
|
"IsOutKsa": false,
|
|
|
|
},
|
|
|
|
"Notes": notes,
|
|
|
|
body: {
|
|
|
|
}, isLiveCare: true);
|
|
|
|
"VC_ID": vcID,
|
|
|
|
}
|
|
|
|
"IsOutKsa": false,
|
|
|
|
|
|
|
|
"Notes": notes,
|
|
|
|
Future isLogin(LiveCareUserLoginRequestModel isLoginRequestModel) async {
|
|
|
|
},isLiveCare: true
|
|
|
|
hasError = false;
|
|
|
|
);
|
|
|
|
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
|
|
|
|
|
|
|
|
isLoginResponse = response;
|
|
|
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
|
|
|
hasError = true;
|
|
|
|
|
|
|
|
super.error = error;
|
|
|
|
|
|
|
|
}, body: isLoginRequestModel.toJson(), isLiveCare: true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|