|
|
|
@ -1,24 +1,16 @@
|
|
|
|
import 'dart:async';
|
|
|
|
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/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/LiveCarePatientViewModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.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/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/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart';
|
|
|
|
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_other.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.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/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.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/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/app_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
|
|
|
|
@ -27,7 +19,6 @@ import 'package:flutter/material.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
import 'package:quiver/async.dart';
|
|
|
|
import 'package:quiver/async.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../../../../locator.dart';
|
|
|
|
|
|
|
|
import '../../../../routes.dart';
|
|
|
|
import '../../../../routes.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class PatientProfileScreen extends StatefulWidget {
|
|
|
|
class PatientProfileScreen extends StatefulWidget {
|
|
|
|
@ -302,42 +293,46 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
|
|
|
|
: TranslationBase.of(context).initiateCall,
|
|
|
|
: TranslationBase.of(context).initiateCall,
|
|
|
|
disabled: isCallStarted || model.state == ViewState.BusyLocal,
|
|
|
|
disabled: isCallStarted || model.state == ViewState.BusyLocal,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.updateInCallPatient(
|
|
|
|
|
|
|
|
patient: patient,
|
|
|
|
|
|
|
|
appointmentNo: 0 );
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
patient.episodeNo = 0 ;
|
|
|
|
|
|
|
|
patient.appointmentNo = 0;
|
|
|
|
|
|
|
|
});
|
|
|
|
// Navigator.push(context, MaterialPageRoute(
|
|
|
|
// Navigator.push(context, MaterialPageRoute(
|
|
|
|
// builder: (BuildContext context) =>
|
|
|
|
// builder: (BuildContext context) =>
|
|
|
|
// EndCallScreen(patient:patient)));
|
|
|
|
// EndCallScreen(patient:patient)));
|
|
|
|
|
|
|
|
|
|
|
|
if (isCallFinished) {
|
|
|
|
// if (isCallFinished) {
|
|
|
|
Navigator.push(
|
|
|
|
// Navigator.push(
|
|
|
|
context,
|
|
|
|
// context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
// MaterialPageRoute(
|
|
|
|
builder: (BuildContext context) => EndCallScreen(patient: patient)));
|
|
|
|
// builder: (BuildContext context) => EndCallScreen(patient: patient)));
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await model.startCall(isReCall: false, vCID: patient.vcId);
|
|
|
|
// await model.startCall(isReCall: false, vCID: patient.vcId);
|
|
|
|
|
|
|
|
//
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
// Helpers.showErrorToast(model.error);
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
await model.getDoctorProfile();
|
|
|
|
// await model.getDoctorProfile();
|
|
|
|
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
|
|
|
|
// patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
|
|
|
|
patient.episodeNo = 0;
|
|
|
|
// patient.episodeNo = 0;
|
|
|
|
setState(() {
|
|
|
|
// setState(() {
|
|
|
|
isCallStarted = true;
|
|
|
|
// isCallStarted = true;
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
// AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
context: context,
|
|
|
|
// context: context,
|
|
|
|
onTapGrant: () {
|
|
|
|
// onTapGrant: () {
|
|
|
|
locator<VideoCallService>()
|
|
|
|
// locator<VideoCallService>()
|
|
|
|
.openVideo(model.startCallRes, patient, callConnected, callDisconnected);
|
|
|
|
// .openVideo(model.startCallRes, patient, callConnected, callDisconnected);
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
|
|
|
|
|
|
|
|
// locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|