Zoom integration updates & other stability fixes

dev_v3.13.6_BLE_Faiz
haroon amjad 1 year ago
parent e962469c7e
commit c97fd25cdd

@ -20,13 +20,11 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'http://10.50.100.198:4422/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
//var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';

@ -1,5 +1,6 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -90,6 +91,7 @@ class _MyApp extends State<MyApp> {
@override
Widget build(BuildContext context) {
PlatformBridge.init(context);
AppGlobal.context = context;
// SystemChrome.setPreferredOrientations([
// DeviceOrientation.portraitUp,

@ -462,7 +462,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// Utils.showProgressDialog(context);
this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) {
print("err:$err");
AppToast.showErrorToast(message: err.toString());
AppToast.showErrorToast(message: err.toString(), localContext: context);
Navigator.of(context).pop();
});
}

@ -66,7 +66,7 @@ class _SchedulePageState extends State<SchedulePage> {
this.generateWeeksSchedules();
} else if (model2.freeSlots.length == 0 && model2.state == ViewState.Idle) {
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule, localContext: context);
Navigator.pop(context);
}
return AppScaffold(

@ -425,7 +425,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: TranslationBase.of(context).noResultFound);
AppToast.showErrorToast(message: TranslationBase.of(context).noResultFound, localContext: context);
});
}
@ -500,7 +500,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
if (res['PatientDoctorAppointmentResultList'].length != 0) {
getCallRequestType();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed);
AppToast.showErrorToast(message: TranslationBase.of(context).askDocNotAllowed, localContext: context);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);

@ -154,7 +154,7 @@ class _CallScreenState extends State<CallScreen> {
var videoOn = await mySelf.videoStatus?.isOn();
var speakerOn = await zoom.audioHelper.getSpeakerStatus();
// fullScreenUser.value = mySelf;
fullScreenUser.value = remoteUsers![0];
fullScreenUser.value = remoteUsers!.isNotEmpty ? remoteUsers![0] : mySelf;
remoteUsers?.insert(0, mySelf);
users.value = remoteUsers!;
isMuted.value = muted!;
@ -168,6 +168,8 @@ class _CallScreenState extends State<CallScreen> {
isInSession.value = false;
users.value = <ZoomVideoSdkUser>[];
fullScreenUser.value = null;
await zoom.leaveSession(false);
Navigator.pop(context);
});
final sessionNeedPasswordListener = emitter.on(EventType.onSessionNeedPassword, (data) async {
@ -265,6 +267,7 @@ class _CallScreenState extends State<CallScreen> {
List<ZoomVideoSdkUser> remoteUserList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList();
remoteUserList.insert(0, mySelf!);
users.value = remoteUserList;
fullScreenUser.value = remoteUserList[1];
});
final userLeaveListener = emitter.on(EventType.onUserLeave, (data) async {
@ -1544,7 +1547,11 @@ class _CallScreenState extends State<CallScreen> {
IconButton(
onPressed: onPressCameraChange,
iconSize: circleButtonSize,
icon: const Icon(Icons.cameraswitch_sharp, size: 45.0, color: Colors.white,),
icon: const Icon(
Icons.cameraswitch_sharp,
size: 45.0,
color: Colors.white,
),
),
// IconButton(
// onPressed: onPressMore,

@ -28,6 +28,7 @@ String generateJwt(String sessionName, String roleType) {
'tpc': sessionName,
'role_type': int.parse(roleType),
'cloud_recording_option': 1,
'cloud_recording_election': 1,
},
);
var token = jwt.sign(SecretKey(configs["ZOOM_SDK_SECRET"]));

@ -49,12 +49,13 @@ class _HomePageState2 extends State<HomePage2> {
HomePageFragment2(
model,
onLoginClick: () {
// widget.onLoginClick!();
Navigator.pushNamed(
context,
"zoom_call_page",
arguments: CallArguments("hoover-dam-4", "", "Patient", "40", "0", true),
);
widget.onLoginClick!();
// Navigator.pushNamed(
// context,
// "zoom_call_page",
// arguments: CallArguments("h9qkpf02", "123", "Patient", "40", "1", false),
// );
},
onPharmacyClick: () {
// getPharmacyToken(model);

@ -394,10 +394,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} else {
// AppGlobal.context = context;
GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) async {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);
var data = await sharedPref.getObject(IMEI_USER_DATA);
if (data != null) {
setUserValues(data);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.hideDialog(context);

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:camera/camera.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart';
import 'package:diplomaticquarterapp/pages/conference/zoom/call_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/pages/webRTC/OpenTok/OpenTok.dart';
@ -16,11 +17,10 @@ import 'package:just_audio/just_audio.dart';
import '../../config/config.dart';
class IncomingCall extends StatefulWidget {
IncomingCallData? incomingCallData;
IncomingCall({ this.incomingCallData});
IncomingCall({this.incomingCallData});
@override
_IncomingCallState createState() => _IncomingCallState();
@ -34,6 +34,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
late CameraController _controller;
late Future<void> _initializeControllerFuture;
bool isCameraReady = false;
// Signaling signaling = Signaling()..init();
@override
@ -59,140 +60,138 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
body: Stack(
alignment: FractionalOffset.center,
children: <Widget>[
// new Positioned.fill(
// child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)),
// ),
new Positioned.fill(
child: new ClipRect(
// child: new BackdropFilter(
// filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(
decoration: new BoxDecoration(color: Colors.grey[800]!.withOpacity(0.8)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
margin: const EdgeInsets.all(21.0),
child: Row(
children: [
Image.asset(
"assets/images/new/logo.png",
height: 70,
width: 70,
),
Container(
margin: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget.incomingCallData!.doctorname!,
style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white, letterSpacing: -1.26, height: 23 / 12),
),
Text(
TranslationBase.of(context).videoAppo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xffC6C6C6), letterSpacing: -0.48, height: 23 / 24),
),
SizedBox(height: 2),
],
),
),
],
body: Stack(alignment: FractionalOffset.center, children: <Widget>[
// new Positioned.fill(
// child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)),
// ),
new Positioned.fill(
child: new ClipRect(
// child: new BackdropFilter(
// filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container(
decoration: new BoxDecoration(color: Colors.grey[800]!.withOpacity(0.8)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
margin: const EdgeInsets.all(21.0),
child: Row(
children: [
Image.asset(
"assets/images/new/logo.png",
height: 70,
width: 70,
),
Container(
margin: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget.incomingCallData!.doctorname!,
style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white, letterSpacing: -1.26, height: 23 / 12),
),
),
Container(
margin: const EdgeInsets.all(21.0),
width: MediaQuery.of(context).size.width,
decoration: cardRadius(15.0, color: Colors.black),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 6.0),
child: Text(
TranslationBase.of(context).appoInfo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 23 / 12),
),
),
Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0),
child: Text(
widget.incomingCallData!.appointmentdate! + ", " + widget.incomingCallData!.appointmenttime!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
),
),
Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 21.0),
child: Text(
widget.incomingCallData!.clinicname!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
),
),
],
Text(
TranslationBase.of(context).videoAppo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xffC6C6C6), letterSpacing: -0.48, height: 23 / 24),
),
),
Spacer(),
Container(
margin: EdgeInsets.only(bottom: 70.0, left: 49, right: 49),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
RotationTransition(
turns: Tween(begin: 0.0, end: -.1).chain(CurveTween(curve: Curves.elasticIn)).animate(_animationController),
child: Container(
child: RawMaterialButton(
onPressed: () {
_submit();
},
elevation: 2.0,
fillColor: Colors.green,
child: Icon(
Icons.call,
color: Colors.white,
size: 35.0,
),
padding: EdgeInsets.all(15.0),
shape: CircleBorder(),
),
)),
Container(
child: RawMaterialButton(
onPressed: () {
backToHome();
},
elevation: 2.0,
fillColor: Colors.red,
child: Icon(
Icons.call_end,
color: Colors.white,
size: 35.0,
),
padding: EdgeInsets.all(15.0),
shape: CircleBorder(),
),
),
],
SizedBox(height: 2),
],
),
),
],
),
),
Container(
margin: const EdgeInsets.all(21.0),
width: MediaQuery.of(context).size.width,
decoration: cardRadius(15.0, color: Colors.black),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 6.0),
child: Text(
TranslationBase.of(context).appoInfo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 23 / 12),
),
),
Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0),
child: Text(
widget.incomingCallData!.appointmentdate! + ", " + widget.incomingCallData!.appointmenttime!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
),
),
Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 21.0),
child: Text(
widget.incomingCallData!.clinicname!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
),
),
],
),
),
Spacer(),
Container(
margin: EdgeInsets.only(bottom: 70.0, left: 49, right: 49),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
RotationTransition(
turns: Tween(begin: 0.0, end: -.1).chain(CurveTween(curve: Curves.elasticIn)).animate(_animationController),
child: Container(
child: RawMaterialButton(
onPressed: () {
_submit();
},
elevation: 2.0,
fillColor: Colors.green,
child: Icon(
Icons.call,
color: Colors.white,
size: 35.0,
),
padding: EdgeInsets.all(15.0),
shape: CircleBorder(),
),
)),
Container(
child: RawMaterialButton(
onPressed: () {
backToHome();
},
elevation: 2.0,
fillColor: Colors.red,
child: Icon(
Icons.call_end,
color: Colors.white,
size: 35.0,
),
],
padding: EdgeInsets.all(15.0),
shape: CircleBorder(),
),
),
),
],
),
),
// ),
]
],
),
),
),
),
// ),
]
// } else {
// return const Center(child: CircularProgressIndicator());
// }
),
),
);
}
@ -213,31 +212,43 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// backToHome();
// final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity);
// await _controller.dispose();
changeCallStatusAPI(4);
await Navigator.of(context).pushReplacement(
MaterialPageRoute(
// fullscreenDialog: true,
builder: (BuildContext context) {
// final caller = widget.incomingCallData.callerID;
// final receiver = widget.incomingCallData.receiverID;
// final host = widget.incomingCallData.server;
// if(widget.incomingCallData.isWebRTC == "true"){
// return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
// }else{
return OpenTokConnectCallPage(
apiKey: OPENTOK_API_KEY,
sessionId: widget.incomingCallData!.sessionId!,
token: widget.incomingCallData!.token!
);
// }
// return VideoCallWebPage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // Web WebRTC VideoCall
LandingPage.isOpenCallPage = false;
player.stop();
changeCallStatusAPI(4);
Navigator.of(context).pop();
// return CallHomePage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // App WebRTC VideoCall
},
),
Navigator.pushNamed(
context,
"zoom_call_page",
arguments: CallArguments(widget.incomingCallData!.sessionId!, "123", "Patient", "40", "1", false),
);
// await Navigator.of(context).pushReplacement(
// MaterialPageRoute(
// // fullscreenDialog: true,
// builder: (BuildContext context) {
// // final caller = widget.incomingCallData.callerID;
// // final receiver = widget.incomingCallData.receiverID;
// // final host = widget.incomingCallData.server;
// // if(widget.incomingCallData.isWebRTC == "true"){
// // return StartVideoCall(caller: caller, receiver: receiver, iAmCaller: false, host: host);
// // }else{
// return OpenTokConnectCallPage(
// apiKey: OPENTOK_API_KEY,
// sessionId: widget.incomingCallData!.sessionId!,
// token: widget.incomingCallData!.token!
// );
// // }
//
// // return VideoCallWebPage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // Web WebRTC VideoCall
//
// // return CallHomePage(receiverId: widget.incomingCallData.receiverID, callerId: widget.incomingCallData.callerID); // App WebRTC VideoCall
//
// },
// ),
// );
} catch (err) {
print(err);
await PlatformExceptionAlertDialog(
@ -248,8 +259,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
void changeCallStatusAPI(int sessionStatus) {
LiveCareService service = new LiveCareService();
service.endCallAPI(widget.incomingCallData!.sessionId!, sessionStatus, context).then((res) {
}).catchError((err) {
service.endCallAPI(widget.incomingCallData!.sessionId!, sessionStatus, context).then((res) {}).catchError((err) {
print(err);
});
}

@ -40,6 +40,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
@ -145,7 +146,7 @@ class _clinic_listState extends State<ClinicList> {
GifLoaderDialogUtils.hideDialog(context);
print(err);
isError = true;
AppToast.showErrorToast(message: err);
AppToast.showErrorToast(message: err, localContext: context);
});
projectViewModel.analytics.liveCare.livecare_immediate_consultation_clinic(clinic: selectedClinicName);
}

@ -78,7 +78,7 @@ class ContactLensPage extends StatelessWidget {
),
),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription!.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve!}'),
getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve ?? "-"}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription!.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription!.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'),

@ -65,7 +65,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
isSortByClinic: false,
isInOutPatient: model.sickLeaveList[index].isInOutPatient,
isSickLeave: true,
sickLeaveStatus: model.sickLeaveList[index].status!,
sickLeaveStatus: model.sickLeaveList[index].status ?? 0,
onEmailTap: () {
showConfirmMessage(model, index);
},

@ -45,12 +45,12 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
prescriptions.doctorName!,
prescriptions.doctorID!,
prescriptions.doctorImageURL!,
prescriptions.speciality!,
prescriptions.speciality ?? [""],
"",
prescriptions.name!,
DateUtil.convertStringToDate(prescriptions.appointmentDate!),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate!)),
prescriptions.nationalityFlagURL!,
prescriptions.nationalityFlagURL ?? "",
prescriptions.doctorRate,
prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate,

@ -65,7 +65,7 @@ class PrescriptionItemsPage extends StatelessWidget {
model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate! : model.prescriptionReportListINP[0].orderDate!,
) : DateTime.now(),
),
prescriptions.nationalityFlagURL!,
prescriptions.nationalityFlagURL ?? "",
prescriptions.doctorRate,
prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate,

@ -67,6 +67,7 @@ class RadiologyDetailsPage extends StatelessWidget {
},
buttonTitle: TranslationBase.of(context).sendCopyRad,
isNeedToShowButton: projectViewModel.havePrivilege(8),
showConfirmMessageDialog: false,
),
Container(
margin: EdgeInsets.all(24),

@ -337,7 +337,8 @@ class LiveCareService extends BaseService {
Future<Map> getOneSignalVOIPToken(String voipToken, BuildContext context) async {
Map<String, dynamic> request;
request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0};
// request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0};
request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0, "test_type": 1};
dynamic localRes;

@ -36,14 +36,14 @@ class _SplashScreenState extends State<SplashScreen> {
void initState() {
AppGlobal.context = context;
super.initState();
print("Splash init called.............");
print("Splash init called.............");
Timer(
Duration(seconds: 1, milliseconds: 500),
() async {
await loadPrivilege().then((value) {
LocalNotification.init(onNotificationClick: (payload) {});
// LocalNotification.getInstance().showNow(title: "Payload", subtitle: "Subtitle", payload: "Payload");
if(!_privilegeService.hasError) {
if (!_privilegeService.hasError) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
@ -54,7 +54,12 @@ class _SplashScreenState extends State<SplashScreen> {
},
);
// startZoom();
var zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig(
domain: "zoom.us",
enableLog: true,
);
zoom.initSdk(initConfig);
// AppSharedPreferences().getAll().then((value) {
// debugPrint("ALL SHARED PREFERENCES!!!!!");
@ -62,15 +67,6 @@ class _SplashScreenState extends State<SplashScreen> {
// });
}
// void startZoom(){
// var zoom = ZoomVideoSdk();
// InitConfig initConfig = InitConfig(
// domain: "zoom.us",
// enableLog: true,
// );
// zoom.initSdk(initConfig);
// }
/// load the Privilege from service
Future loadPrivilege() async {
await _privilegeService.getPrivilege();

@ -17,13 +17,7 @@ class AppToast {
int? imageSize,
}) {
Fluttertoast.showToast(
msg: message,
toastLength: toastLength,
gravity: toastGravity,
timeInSecForIosWeb: timeInSeconds!,
backgroundColor: backgroundColor,
textColor: textColor,
fontSize: fontSize);
msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize);
}
static void showSuccessToast({
@ -38,28 +32,22 @@ class AppToast {
int imageSize = 32,
}) {
Fluttertoast.showToast(
msg: message,
toastLength: toastLength,
gravity: toastGravity,
timeInSecForIosWeb: timeInSeconds ?? 0,
backgroundColor: Colors.green,
textColor: textColor,
fontSize: fontSize);
msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds ?? 0, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize);
}
static void showErrorToast({
required String message,
Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds = 2,
double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white,
int radius = 15,
int? elevation,
int imageSize = 32,
}) {
static void showErrorToast(
{required String message,
Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds = 2,
double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white,
int radius = 15,
int? elevation,
int imageSize = 32,
BuildContext? localContext}) {
FToast fToast = FToast();
fToast.init(AppGlobal.context);
fToast.init(localContext != null ? localContext : AppGlobal.context);
Widget toast = Container(
padding: EdgeInsets.all(8),
alignment: Alignment.topCenter,
@ -93,8 +81,7 @@ class AppToast {
}
void backWithEmpty() {
AppToast.showErrorToast(
message: TranslationBase.of(AppGlobal.context).empty);
AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).empty);
Navigator.of(AppGlobal.context).pop();
}

@ -5,8 +5,10 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart';
import 'package:diplomaticquarterapp/pages/conference/zoom/call_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/webRTC/OpenTok/OpenTok.dart';
@ -209,6 +211,20 @@ class PushNotificationHandler {
static PushNotificationHandler getInstance() => _instance;
void _timeOut({
int seconds = 30,
}) async {
timeOutTimer = Timer(Duration(seconds: seconds), () async {
print('🎈 example: timeOut');
final incomingCallerName = await voIPKit.getIncomingCallerName();
voIPKit.unansweredIncomingCall(
skipLocalNotification: false,
missedCallTitle: '📞 Missed call',
missedCallBody: 'There was a call from $incomingCallerName',
);
});
}
init(BuildContext context) async {
this.context = context;
@ -217,6 +233,51 @@ class PushNotificationHandler {
print("APNS VOIP KIT TOKEN: $value");
AppSharedPreferences().setString(APNS_TOKEN, value!);
});
voIPKit.onDidUpdatePushToken = (String token) {
print('🎈 example: onDidUpdatePushToken: $token');
};
voIPKit.onDidReceiveIncomingPush = (
Map<String, dynamic> payload,
) async {
print('🎈 example: onDidReceiveIncomingPush $payload');
_timeOut();
};
voIPKit.onDidRejectIncomingCall = (
String uuid,
String callerId,
) async {
try {
print('🎈 example: onDidRejectIncomingCall $uuid - $callerId');
timeOutTimer.cancel();
} catch (err) {}
};
voIPKit.onDidAcceptIncomingCall = (
String uuid,
String callerId,
) async {
print('🎈 example: onDidAcceptIncomingCall $uuid - $callerId');
await voIPKit.acceptIncomingCall(callerState: CallStateType.calling);
await voIPKit.callConnected();
await Future.delayed(Duration(seconds: 1));
Navigator.pushNamed(
locator<NavigationService>().navigatorKey.currentContext!,
"zoom_call_page",
arguments: CallArguments("hoover-dam", "123", "Patient", "40", "1", false),
);
await voIPKit.endCall();
// Navigator.pushNamed(navigatorKey.currentContext!, VIDEO_CALL_SCREEN,
// arguments: VideoArgus(
// reservationId: int.parse(callerId), token: null, isVideo: true));
timeOutTimer.cancel();
};
}
if (Platform.isAndroid) {
@ -311,8 +372,7 @@ class PushNotificationHandler {
onToken(token!);
});
if(Platform.isIOS) {
if (Platform.isIOS) {
FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value!);
});
@ -372,7 +432,6 @@ class PushNotificationHandler {
].request();
print("=-=-=-=-=-=-=-=-=-=-");
print(statuses[Permission.location]);
}
} catch (_) {
debugPrint(_.toString());

Loading…
Cancel
Save