|
|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/live_care/live-care_transfer_to_admin.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/VideoChannel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
@ -44,10 +47,51 @@ class _EndCallScreenState extends State<EndCallScreen> {
|
|
|
|
|
final List<PatientProfileCardModel> cardsList = [
|
|
|
|
|
PatientProfileCardModel(TranslationBase.of(context).resume,
|
|
|
|
|
TranslationBase.of(context).theCall, '', 'patient/vital_signs.png',
|
|
|
|
|
isInPatient: isInpatient,
|
|
|
|
|
onTap: () {},
|
|
|
|
|
isDartIcon: true,
|
|
|
|
|
dartIcon: DoctorApp.call),
|
|
|
|
|
isInPatient: isInpatient, onTap: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await liveCareModel
|
|
|
|
|
.startCall(isReCall: false, vCID: widget.patient.vcId)
|
|
|
|
|
.then((value) async{
|
|
|
|
|
await liveCareModel.getDoctorProfile();
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (liveCareModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(liveCareModel.error);
|
|
|
|
|
}else
|
|
|
|
|
await VideoChannel.openVideoCallScreen(
|
|
|
|
|
kToken: liveCareModel.startCallRes.openTokenID,
|
|
|
|
|
kSessionId: liveCareModel.startCallRes.openSessionID,
|
|
|
|
|
kApiKey: '46209962',
|
|
|
|
|
vcId: widget.patient.vcId,
|
|
|
|
|
tokenID: await liveCareModel.getToken(),
|
|
|
|
|
generalId: GENERAL_ID,
|
|
|
|
|
doctorId: liveCareModel.doctorProfile.doctorID,
|
|
|
|
|
onFailure: (String error) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(error);
|
|
|
|
|
},
|
|
|
|
|
onCallEnd: () async{
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await liveCareModel.endCall(widget.patient.vcId, false,);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (liveCareModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(liveCareModel.error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onCallNotRespond: (SessionStatusModel sessionStatusModel) async{
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await liveCareModel.endCall(widget.patient.vcId, sessionStatusModel.sessionStatus == 3,);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (liveCareModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(liveCareModel.error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (liveCareModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(liveCareModel.error);
|
|
|
|
|
}
|
|
|
|
|
}, isDartIcon: true, dartIcon: DoctorApp.call),
|
|
|
|
|
PatientProfileCardModel(
|
|
|
|
|
TranslationBase.of(context).endLC,
|
|
|
|
|
TranslationBase.of(context).consultation,
|
|
|
|
|
@ -59,7 +103,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
|
|
|
|
|
() async {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
liveCareModel.endCallWithCharge(widget.patient.vcId);
|
|
|
|
|
await liveCareModel.endCallWithCharge(widget.patient.vcId);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (liveCareModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(liveCareModel.error);
|
|
|
|
|
@ -77,14 +121,19 @@ class _EndCallScreenState extends State<EndCallScreen> {
|
|
|
|
|
onTap: () {},
|
|
|
|
|
isInPatient: isInpatient,
|
|
|
|
|
isDartIcon: true,
|
|
|
|
|
isDisable: true,
|
|
|
|
|
dartIcon: DoctorApp.send_instruction),
|
|
|
|
|
PatientProfileCardModel(TranslationBase.of(context).transferTo,
|
|
|
|
|
TranslationBase.of(context).admin, '', 'patient/health_summary.png',
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, MaterialPageRoute(
|
|
|
|
|
PatientProfileCardModel(
|
|
|
|
|
TranslationBase.of(context).transferTo,
|
|
|
|
|
TranslationBase.of(context).admin,
|
|
|
|
|
'',
|
|
|
|
|
'patient/health_summary.png', onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
LivaCareTransferToAdmin(patient:widget.patient)));
|
|
|
|
|
},
|
|
|
|
|
LivaCareTransferToAdmin(patient: widget.patient)));
|
|
|
|
|
},
|
|
|
|
|
isInPatient: isInpatient,
|
|
|
|
|
isDartIcon: true,
|
|
|
|
|
dartIcon: DoctorApp.transfer_to_admin),
|
|
|
|
|
@ -197,7 +246,9 @@ class _EndCallScreenState extends State<EndCallScreen> {
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
color: Colors.red[600],
|
|
|
|
|
title: "Close", //TranslationBase.of(context).close,
|
|
|
|
|
onPressed: () async {},
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|