|
|
|
@ -1,12 +1,10 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/service/VideoCallService.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/end_call_screen.dart';
|
|
|
|
@ -14,11 +12,8 @@ import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profi
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/NotificationPermissionUtils.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';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
@ -306,45 +301,48 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
|
|
|
|
|
: TranslationBase.of(context).initiateCall,
|
|
|
|
|
disabled: isCallStarted || model.state == ViewState.BusyLocal,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
// Navigator.push(context, MaterialPageRoute(
|
|
|
|
|
// builder: (BuildContext context) =>
|
|
|
|
|
// EndCallScreen(patient:patient)));
|
|
|
|
|
|
|
|
|
|
if (isCallFinished) {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => EndCallScreen(patient: patient)));
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
EndCallScreen(patient: patient)));
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.startCall(isReCall: false, vCID: patient.vcId);
|
|
|
|
|
await model.startCall(
|
|
|
|
|
isReCall: false, vCID: patient.vcId);
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
await model.getDoctorProfile();
|
|
|
|
|
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
|
|
|
|
|
patient.appointmentNo = int.parse(model
|
|
|
|
|
.startCallRes.appointmentNo
|
|
|
|
|
.toString());
|
|
|
|
|
patient.episodeNo = 0;
|
|
|
|
|
model.updateInCallPatient(
|
|
|
|
|
patient: patient,
|
|
|
|
|
appointmentNo: int.parse(model
|
|
|
|
|
.startCallRes.appointmentNo
|
|
|
|
|
.toString()));
|
|
|
|
|
setState(() {
|
|
|
|
|
isCallStarted = true;
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
|
context: context,
|
|
|
|
|
onTapGrant: () {
|
|
|
|
|
locator<VideoCallService>()
|
|
|
|
|
.openVideo(model.startCallRes, patient, model.startCallRes.isRecording, callConnected, callDisconnected);
|
|
|
|
|
});
|
|
|
|
|
AppPermissionsUtils
|
|
|
|
|
.requestVideoCallPermission(
|
|
|
|
|
context: context,
|
|
|
|
|
onTapGrant: () {
|
|
|
|
|
locator<VideoCallService>()
|
|
|
|
|
.openVideo(
|
|
|
|
|
model.startCallRes,
|
|
|
|
|
patient,
|
|
|
|
|
model.startCallRes.isRecording, callConnected,
|
|
|
|
|
callDisconnected);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
|
// context: context,
|
|
|
|
|
// onTapGrant: () {
|
|
|
|
|
// locator<VideoCallService>()
|
|
|
|
|
// .openVideo(model.startCallRes, patient, true, callConnected, callDisconnected);
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|