Add video call service

merge-requests/745/head
Mohammad Aljammal 5 years ago
parent 0868de7961
commit 746f44157e

@ -370,6 +370,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
} }
isConnected = true isConnected = true
subscribeToStream(stream) subscribeToStream(stream)
if (mConnectedHandler != null && mConnectedRunnable != null)
mConnectedHandler!!.removeCallbacks(mConnectedRunnable!!)
videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(3, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid))
} }

@ -3,9 +3,15 @@ import 'package:flutter/material.dart';
class NavigationService { class NavigationService {
final GlobalKey<NavigatorState> navigatorKey = final GlobalKey<NavigatorState> navigatorKey =
new GlobalKey<NavigatorState>(); new GlobalKey<NavigatorState>();
Future<dynamic> navigateTo(String routeName) { Future<dynamic> navigateTo(String routeName,{Object arguments}) {
return navigatorKey.currentState.pushNamed(routeName); return navigatorKey.currentState.pushNamed(routeName,arguments: arguments);
} }
Future<dynamic> pushReplacementNamed(String routeName,{Object arguments}) {
return navigatorKey.currentState.pushReplacementNamed(routeName,arguments: arguments);
}
Future<dynamic> pushNamedAndRemoveUntil(String routeName) { Future<dynamic> pushNamedAndRemoveUntil(String routeName) {
return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false); return navigatorKey.currentState.pushNamedAndRemoveUntil(routeName,(asd)=>false);
} }

@ -0,0 +1,88 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import '../../locator.dart';
import '../../routes.dart';
import 'NavigationService.dart';
class VideoCallService extends BaseService{
StartCallRes startCallRes;
PatiantInformtion patient;
LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
openVideo(StartCallRes startModel,PatiantInformtion patientModel,VoidCallback onCallConnected, VoidCallback onCallDisconnected)async{
this.startCallRes = startModel;
this.patient = patientModel;
DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//startCallRes.openTokenID,
kSessionId: "1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",//startCallRes.openSessionID,
kApiKey: '47247954',//'46209962',
vcId: patient.vcId,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await sharedPref.getString(TOKEN),
generalId: GENERAL_ID,
doctorId: doctorProfile.doctorID,
onFailure: (String error) {
DrAppToastMsg.showErrorToast(error);
},onCallConnected: onCallConnected,
onCallEnd: () {
WidgetsBinding.instance.addPostFrameCallback((_) async {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
endCall(patient.vcId, false,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
}else
locator<NavigationService>().navigateTo(PATIENTS_END_Call,arguments: {
"patient": patient,
});
});
});
},
onCallNotRespond: (SessionStatusModel sessionStatusModel) {
WidgetsBinding.instance.addPostFrameCallback((_) {
GifLoaderDialogUtils.showMyDialog(locator<NavigationService>().navigatorKey.currentContext);
endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) {
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext);
if (hasError) {
DrAppToastMsg.showErrorToast(error);
} else {
locator<NavigationService>().navigateTo(PATIENTS_END_Call,arguments: {
"patient": patient,
});
}
});
});
});
}
Future endCall(int vCID, bool isPatient) async {
hasError = false;
// await getDoctorProfile(isGetProfile: true);
EndCallReq endCallReq = new EndCallReq();
endCallReq.doctorId = doctorProfile.doctorID;
endCallReq.generalid = 'Cs2020@2016\$2958';
endCallReq.vCID = vCID;
endCallReq.isDestroy = isPatient;
//await _liveCarePatientServices.endCall(endCallReq);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
}
}
}

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/screens/home/home_screen.dart';
import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.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/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -33,7 +34,7 @@ class _LandingPageState extends State<LandingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AppScaffold(
appBar: currentTab != 0 appBar: currentTab != 0
? AppBar( ? AppBar(
elevation: 0, elevation: 0,

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/NavigationService.dart'; import 'core/service/NavigationService.dart';
import 'core/service/VideoCallService.dart';
import 'core/service/home/dasboard_service.dart'; import 'core/service/home/dasboard_service.dart';
import 'core/service/home/doctor_reply_service.dart'; import 'core/service/home/doctor_reply_service.dart';
import 'core/service/home/schedule_service.dart'; import 'core/service/home/schedule_service.dart';
@ -96,6 +97,7 @@ void setupLocator() {
locator.registerLazySingleton(() => NavigationService()); locator.registerLazySingleton(() => NavigationService());
locator.registerLazySingleton(() => ScanQrService()); locator.registerLazySingleton(() => ScanQrService());
locator.registerLazySingleton(() => SpecialClinicsService()); locator.registerLazySingleton(() => SpecialClinicsService());
locator.registerLazySingleton(() => VideoCallService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/root_page.dart';
import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart';
import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart';
import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart';
@ -37,6 +38,7 @@ const String LOGIN = 'login';
const String VERIFICATION_METHODS = 'verification-methods'; const String VERIFICATION_METHODS = 'verification-methods';
const String PATIENTS = 'patients/patients'; const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile'; const String PATIENTS_PROFILE = 'patients/patients-profile';
const String PATIENTS_END_Call = 'patients/patients-profile/endCall';
const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile';
const String LAB_RESULT = 'patients/lab_result'; const String LAB_RESULT = 'patients/lab_result';
const String HEALTH_SUMMARY = 'patients/health-summary'; const String HEALTH_SUMMARY = 'patients/health-summary';
@ -88,6 +90,7 @@ var routes = {
PATIENT_MEDICAL_REPORT: (_) => MedicalReportPage(), PATIENT_MEDICAL_REPORT: (_) => MedicalReportPage(),
PATIENT_MEDICAL_REPORT_INSERT: (_) => AddVerifyMedicalReport(), PATIENT_MEDICAL_REPORT_INSERT: (_) => AddVerifyMedicalReport(),
PATIENT_MEDICAL_REPORT_DETAIL: (_) => MedicalReportDetailPage(), PATIENT_MEDICAL_REPORT_DETAIL: (_) => MedicalReportDetailPage(),
PATIENTS_END_Call: (_) => EndCallScreen(),
CREATE_EPISODE: (_) => UpdateSoapIndex( CREATE_EPISODE: (_) => UpdateSoapIndex(
isUpdate: true, isUpdate: true,
), ),

@ -23,9 +23,9 @@ import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class EndCallScreen extends StatefulWidget { class EndCallScreen extends StatefulWidget {
final PatiantInformtion patient;
const EndCallScreen({Key key, this.patient}) : super(key: key);
const EndCallScreen({Key key,}) : super(key: key);
@override @override
_EndCallScreenState createState() => _EndCallScreenState(); _EndCallScreenState createState() => _EndCallScreenState();
@ -33,7 +33,7 @@ class EndCallScreen extends StatefulWidget {
class _EndCallScreenState extends State<EndCallScreen> { class _EndCallScreenState extends State<EndCallScreen> {
bool isInpatient = false; bool isInpatient = false;
PatiantInformtion patient;
bool isDischargedPatient = false; bool isDischargedPatient = false;
bool isSearchAndOut = false; bool isSearchAndOut = false;
String patientType; String patientType;
@ -43,6 +43,13 @@ class _EndCallScreenState extends State<EndCallScreen> {
LiveCarePatientViewModel liveCareModel; LiveCarePatientViewModel liveCareModel;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<PatientProfileCardModel> cardsList = [ final List<PatientProfileCardModel> cardsList = [
@ -53,7 +60,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
onTap: () async { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel await liveCareModel
.startCall(isReCall: false, vCID: widget.patient.vcId) .startCall(isReCall: false, vCID: patient.vcId)
.then((value) async { .then((value) async {
await liveCareModel.getDoctorProfile(); await liveCareModel.getDoctorProfile();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -64,8 +71,8 @@ class _EndCallScreenState extends State<EndCallScreen> {
kToken: liveCareModel.startCallRes.openTokenID, kToken: liveCareModel.startCallRes.openTokenID,
kSessionId: liveCareModel.startCallRes.openSessionID, kSessionId: liveCareModel.startCallRes.openSessionID,
kApiKey: '46209962', kApiKey: '46209962',
vcId: widget.patient.vcId, vcId: patient.vcId,
patientName: widget.patient.fullName ?? (widget.patient.firstName != null ? "${widget.patient.firstName} ${widget.patient.lastName}" : "-"), patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await liveCareModel.getToken(), tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID, generalId: GENERAL_ID,
doctorId: liveCareModel.doctorProfile.doctorID, doctorId: liveCareModel.doctorProfile.doctorID,
@ -76,7 +83,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall( await liveCareModel.endCall(
widget.patient.vcId, patient.vcId,
false, false,
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -89,7 +96,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCall( await liveCareModel.endCall(
widget.patient.vcId, patient.vcId,
sessionStatusModel.sessionStatus == 3, sessionStatusModel.sessionStatus == 3,
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -116,14 +123,14 @@ class _EndCallScreenState extends State<EndCallScreen> {
() async { () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.getAlternativeServices(widget.patient.vcId); await liveCareModel.getAlternativeServices(patient.vcId);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
} else { } else {
showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async { showAlternativesDialog(context, liveCareModel, (bool isConfirmed) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.endCallWithCharge(widget.patient.vcId, isConfirmed); await liveCareModel.endCallWithCharge(patient.vcId, isConfirmed);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
@ -147,7 +154,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
() async { () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await liveCareModel.sendSMSInstruction(widget.patient.vcId); await liveCareModel.sendSMSInstruction(patient.vcId);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) { if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
@ -169,7 +176,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (BuildContext context) => builder: (BuildContext context) =>
LivaCareTransferToAdmin(patient: widget.patient))); LivaCareTransferToAdmin(patient: patient)));
}, },
isInPatient: isInpatient, isInPatient: isInpatient,
isDartIcon: true, isDartIcon: true,
@ -186,10 +193,14 @@ class _EndCallScreenState extends State<EndCallScreen> {
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: true, isShowAppBar: true,
appBar: PatientProfileAppBar( appBar: PatientProfileAppBar(
widget.patient, patient,
onPressed: (){
Navigator.pop(context);
},
isInpatient: isInpatient, isInpatient: isInpatient,
height: (widget.patient.patientStatusType != null && height: (patient.patientStatusType != null &&
widget.patient.patientStatusType == 43) patient.patientStatusType == 43)
? 210 ? 210
: isDischargedPatient : isDischargedPatient
? 240 ? 240
@ -232,7 +243,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
staggeredTileBuilder: (int index) => StaggeredTile.fit(1), staggeredTileBuilder: (int index) => StaggeredTile.fit(1),
itemBuilder: (BuildContext context, int index) => itemBuilder: (BuildContext context, int index) =>
PatientProfileButton( PatientProfileButton(
patient: widget.patient, patient: patient,
patientType: patientType, patientType: patientType,
arrivalType: arrivalType, arrivalType: arrivalType,
from: from, from: from,
@ -331,6 +342,7 @@ class _EndCallScreenState extends State<EndCallScreen> {
), ),
AppButton( AppButton(
onPressed: () { onPressed: () {
Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
okFunction(false); okFunction(false);
}, },

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart'; 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';
@ -25,6 +26,7 @@ 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 {
@ -91,6 +93,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
if(routeArgs.containsKey("isFromLiveCare")) { if(routeArgs.containsKey("isFromLiveCare")) {
isFromLiveCare = routeArgs['isFromLiveCare']; isFromLiveCare = routeArgs['isFromLiveCare'];
} }
if(routeArgs.containsKey("isCallFinished")) {
isCallFinished = routeArgs['isCallFinished'];
}
if (isInpatient) if (isInpatient)
_activeTab = 0; _activeTab = 0;
else else
@ -333,9 +338,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
if(isCallFinished) { if(isCallFinished) {
Navigator.push(context, MaterialPageRoute( // Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => // builder: (BuildContext context) => EndCallScreen(patient:patient)));
EndCallScreen(patient:patient))); var asd = "";
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
// await model.startCall( isReCall : false, vCID: patient.vcId); // await model.startCall( isReCall : false, vCID: patient.vcId);
@ -349,49 +354,54 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
patient.episodeNo = 0; patient.episodeNo = 0;
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
await VideoChannel.openVideoCallScreen( locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID,
kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID, // await VideoChannel.openVideoCallScreen(
kApiKey: '47247954',//46209962 // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==",//model.startCallRes.openTokenID,
vcId: patient.vcId, // kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg",// model.startCallRes.openSessionID,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), // kApiKey: '47247954',//46209962
tokenID: await model.getToken(), // vcId: patient.vcId,
generalId: GENERAL_ID, // patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
doctorId: model.doctorProfile.doctorID, // tokenID: await model.getToken(),
onFailure: (String error) { // generalId: GENERAL_ID,
DrAppToastMsg.showErrorToast(error); // doctorId: model.doctorProfile.doctorID,
},onCallConnected: callConnected, // onFailure: (String error) {
onCallEnd: () { // DrAppToastMsg.showErrorToast(error);
var asd=""; // },onCallConnected: callConnected,
// WidgetsBinding.instance.addPostFrameCallback((_) { // onCallEnd: () {
// GifLoaderDialogUtils.showMyDialog(context); // var asd="";
// model.endCall(patient.vcId, false,).then((value) { // WidgetsBinding.instance.addPostFrameCallback((_) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
// if (model.state == ViewState.ErrorLocal) { // model.endCall(patient.vcId, false,).then((value) {
// DrAppToastMsg.showErrorToast(model.error); // GifLoaderDialogUtils.hideDialog(context);
// } // if (model.state == ViewState.ErrorLocal) {
// setState(() { // DrAppToastMsg.showErrorToast(model.error);
// isCallFinished = true; // }
// }); // setState(() {
// }); // isCallFinished = true;
// }); // });
}, // });
onCallNotRespond: (SessionStatusModel sessionStatusModel) { // });
var asd=""; // Navigator.push(context, MaterialPageRoute(
// WidgetsBinding.instance.addPostFrameCallback((_) { // builder: (BuildContext context) =>
// GifLoaderDialogUtils.showMyDialog(context); // EndCallScreen(patient:patient)));
// model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { // },
// GifLoaderDialogUtils.hideDialog(context); // onCallNotRespond: (SessionStatusModel sessionStatusModel) {
// if (model.state == ViewState.ErrorLocal) { // var asd="";
// DrAppToastMsg.showErrorToast(model.error); // // WidgetsBinding.instance.addPostFrameCallback((_) {
// } // // GifLoaderDialogUtils.showMyDialog(context);
// setState(() { // // model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) {
// isCallFinished = true; // // GifLoaderDialogUtils.hideDialog(context);
// }); // // if (model.state == ViewState.ErrorLocal) {
// }); // // DrAppToastMsg.showErrorToast(model.error);
// // // }
// }); // // setState(() {
}); // // isCallFinished = true;
// // });
// // });
// //
// // });
// });
} }
} }

@ -33,6 +33,7 @@ class PatientProfileAppBar extends StatelessWidget
final String clinic; final String clinic;
final bool isAppointmentHeader; final bool isAppointmentHeader;
final bool isFromLabResult; final bool isFromLabResult;
final VoidCallback onPressed;
PatientProfileAppBar( PatientProfileAppBar(
this.patient, this.patient,
@ -52,7 +53,7 @@ class PatientProfileAppBar extends StatelessWidget
this.episode, this.episode,
this.visitDate, this.visitDate,
this.isAppointmentHeader = false, this.isAppointmentHeader = false,
this.isFromLabResult = false}); this.isFromLabResult = false, this.onPressed});
@override @override
@ -93,7 +94,11 @@ class PatientProfileAppBar extends StatelessWidget
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () {
if(onPressed!=null)
onPressed();
Navigator.pop(context);
},
), ),
Expanded( Expanded(
child: AppText( child: AppText(

@ -19,8 +19,11 @@ class AppScaffold extends StatelessWidget {
final Widget bottomSheet; final Widget bottomSheet;
final Color backgroundColor; final Color backgroundColor;
final Widget appBar; final Widget appBar;
final Widget drawer;
final Widget bottomNavigationBar;
final String subtitle; final String subtitle;
final bool isHomeIcon; final bool isHomeIcon;
final bool extendBody;
AppScaffold( AppScaffold(
{this.appBarTitle = '', {this.appBarTitle = '',
this.body, this.body,
@ -30,7 +33,7 @@ class AppScaffold extends StatelessWidget {
this.bottomSheet, this.bottomSheet,
this.backgroundColor, this.backgroundColor,
this.isHomeIcon = true, this.isHomeIcon = true,
this.appBar, this.subtitle}); this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,6 +45,9 @@ class AppScaffold extends StatelessWidget {
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor ?? Colors.white, backgroundColor: backgroundColor ?? Colors.white,
drawer: drawer,
extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar appBar: isShowAppBar
? appBar ?? ? appBar ??
AppBar( AppBar(

Loading…
Cancel
Save