diff --git a/assets/images/new/logo.png b/assets/images/new/logo.png new file mode 100644 index 00000000..29719b35 Binary files /dev/null and b/assets/images/new/logo.png differ diff --git a/assets/images/pharmacy_module/payment/applePay.png b/assets/images/pharmacy_module/payment/applePay.png new file mode 100644 index 00000000..fd167e1c Binary files /dev/null and b/assets/images/pharmacy_module/payment/applePay.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 42861cce..dafe7ab9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index aa9c5b16..6c967485 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1532,6 +1532,7 @@ const Map localizedValues = { "rateDoctorAppo": {"en": "Rate DR & Appointment", "ar": "تقييم الطبيب والموعد"}, "invoice": {"en": "Invoice", "ar": "الفاتورة"}, "requestedDate": {"en": "Req Date", "ar": "التاريخ "}, + "requestedDateLiveCare": {"en": "Requested Date: ", "ar": "التاريخ: "}, "callDuration": {"en": "Call Duration", "ar": "مدة الاتصال"}, "alreadyRated": {"en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً"}, "insuranceCompany": {"en": "Insurance Company", "ar": "شركة تأمين"}, @@ -1724,7 +1725,6 @@ const Map localizedValues = { "dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"}, "dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"}, "dietZone":{"en":"Zone Diet","ar":"حمية زون"}, - "Protein": {"en": "Protein", "ar": "بروتين"}, "Cals": {"en": "Cals", "ar": "كالس"}, "gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"}, @@ -1737,4 +1737,6 @@ const Map localizedValues = { "productOutOfStock": {"en": "Out Of Stock", "ar": "إنتهى من المخزن"}, "productQuantity": {"en": "Quantity", "ar": "كمية"}, + "yourTurn": {"en": "your turn is after", "ar": "دورك بعد"}, + "patients": {"en": "patients", "ar": "مرضي"}, }; diff --git a/lib/core/service/PrescriptionDeliveryService.dart b/lib/core/service/PrescriptionDeliveryService.dart index 1d849755..28e5bae4 100644 --- a/lib/core/service/PrescriptionDeliveryService.dart +++ b/lib/core/service/PrescriptionDeliveryService.dart @@ -28,7 +28,7 @@ class PrescriptionDeliveryService extends BaseService { body['AppointmentNo'] = appointmentNo.toString(); // body['CreatedBy'] = createdBy; body['DischargeID'] = dischargeID.toString(); - await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) { var asd = ""; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index 0a7d9e68..01ea61e3 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -55,7 +55,7 @@ class PrescriptionsService extends BaseService { prescriptionsOrderListRC.clear(); Map body = Map(); body['ID'] = orderID; - await baseAppClient.post(GET_ALL_PRESCRIPTION_INFO_RC + "?PatientId=" + patientID.toString(), onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALL_PRESCRIPTION_INFO_RC + "?PatientId=" + patientID.toString(), isRCService: true, onSuccess: (dynamic response, int statusCode) { response['response']['report'].forEach((prescriptionsOrder) { prescriptionsOrderListRC.add(PrescriptionInfoRCModel.fromJson(prescriptionsOrder)); }); @@ -69,7 +69,7 @@ class PrescriptionsService extends BaseService { prescriptionsOrderList.clear(); Map body = Map(); // body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_ALL_PRESCRIPTION_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ALL_PRESCRIPTION_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) { response['response'].forEach((prescriptionsOrder) { prescriptionsOrderList.add(GetCMCAllOrdersResponseModel.fromJson(prescriptionsOrder)); }); diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart index 8b56b739..52892641 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -248,6 +248,9 @@ class OrderPreviewService extends BaseService { case 4: return "INSTALLMENT"; break; + case 5: + return "ApplePay"; + break; default: return ""; } diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index f480fb56..dd1030c6 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -147,9 +147,9 @@ class PrescriptionsViewModel extends BaseViewModel { } } - getPrescriptionReportDetailsRC() async { + getPrescriptionReportDetailsRC(int orderID, dynamic patientID) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionsInfoRC(4, 2001273); + await _prescriptionsService.getPrescriptionsInfoRC(orderID, patientID); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart index 6d212d2b..12623290 100644 --- a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -156,6 +156,8 @@ class OrderPreviewViewModel extends BaseViewModel { case 4: return "${assetFile}installment.png"; break; + case 5: + return "${assetFile}applePay.png"; default: return ""; } diff --git a/lib/main.dart b/lib/main.dart index 50a7e1a0..15e91291 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,7 +27,7 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); FirebaseApp defaultApp = await Firebase.initializeApp(); - setupLocator(); + await setupLocator(); runApp(MyApp()); } @@ -39,6 +39,8 @@ class MyApp extends StatefulWidget { class _MyApp extends State { AppUpdateInfo _updateInfo; + final GlobalKey navigatorKey = GlobalKey(); + Future checkForUpdate() async { InAppUpdate.checkForUpdate().then((info) { if (info.updateAvailable) { @@ -112,7 +114,7 @@ class _MyApp extends State { // ], navigatorKey: locator().navigatorKey, showSemanticsDebugger: false, - title: 'Diplomatic Quarter App', + title: 'Dr. AlHabib', locale: projectProvider.appLocal, localizationsDelegates: [ TranslationBaseDelegate(), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index db41840d..aeb0af07 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -26,6 +26,7 @@ import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; @@ -422,6 +423,17 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (message.containsKey('data')) { LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); LandingPage.isOpenCallPage = true; + // Future.delayed(Duration(seconds: 3), () { + // Navigator.push(locator().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))); + NavigationService.instance.navigateTo(INCOMING_CALL_PAGE); + // }); + // if (!isPageNavigated) { + // isPageNavigated = true; + // Navigator.push(locator().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))); + // .then((value) { + // isPageNavigated = false; + // }); + // } } if (message.containsKey('notification')) { diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index 7e586942..b02676e0 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -1,9 +1,14 @@ +import 'dart:ui'; + +import 'package:camera/camera.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; import 'package:diplomaticquarterapp/pages/conference/conference_page.dart'; import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart'; import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:just_audio/just_audio.dart'; @@ -21,10 +26,14 @@ class _IncomingCallState extends State with SingleTickerProviderSt AnimationController _animationController; final player = AudioPlayer(); + CameraController _controller; + Future _initializeControllerFuture; + bool isCameraReady = false; @override void initState() { _animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500)); + isCameraReady = false; WidgetsBinding.instance.addPostFrameCallback((_) => _runAnimation()); @@ -39,6 +48,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt void dispose() { _animationController.dispose(); player.stop(); + _controller.dispose(); disposeAudioResources(); super.dispose(); } @@ -48,118 +58,279 @@ class _IncomingCallState extends State with SingleTickerProviderSt return AppScaffold( isShowAppBar: false, isShowDecPage: false, - body: SafeArea( - child: Container( - decoration: BoxDecoration(color: Colors.grey[700]), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, + body: FutureBuilder( + future: _initializeControllerFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + return Stack( + alignment: FractionalOffset.center, children: [ - Container( - margin: EdgeInsets.only(top: 30.0), - alignment: Alignment.center, - child: Text("Incoming Video Call", textAlign: TextAlign.center, style: TextStyle(fontSize: 26.0, color: Colors.white, letterSpacing: 1.0)), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.fromLTRB(50.0, 30.0, 50.0, 20.0), - child: Image.asset('assets/images/new-design/hmg_full_logo_hd_white.png'), - ), - Container( - margin: EdgeInsets.fromLTRB(30.0, 10.0, 30.0, 0.0), - child: Divider( - color: Colors.white, - thickness: 1.0, - ), - ), - Container( - margin: EdgeInsets.only(top: 20.0), - alignment: Alignment.center, - child: Text("Dr Eyad Ismail Abu Jayab", textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, letterSpacing: 0.8, color: Colors.white)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text("ENT Clinic", textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, letterSpacing: 0.8, color: Colors.white)), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.center, - child: Text("Speciality", textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, letterSpacing: 0.8, color: Colors.white)), - ), - Container( - decoration: BoxDecoration( - color: Colors.grey[900].withOpacity(0.8), - borderRadius: BorderRadius.all(Radius.circular(10.0)), - ), - padding: EdgeInsets.all(20.0), - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Text("Appointment Information", textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, letterSpacing: 1.0, color: Colors.white)), - Container( - margin: EdgeInsets.only(top: 20.0), - child: Text("Sun, 15th Dec, 2019, 09:00", textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, letterSpacing: 1.0, color: Colors.white)), - ), - Container( - margin: EdgeInsets.only(top: 20.0), - child: Text("ENT Clinic", textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, letterSpacing: 1.0, color: Colors.white)), - ), - ], - ), + new Positioned.fill( + child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)), ), - Container( - margin: EdgeInsets.only(top: 100.0), - alignment: Alignment.center, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - 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, + 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), + ], + ), + ), + ], + ), + ), + 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: [ + 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: () { + LandingPage.isOpenCallPage = false; + 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(), + ), + ), + ], ), - padding: EdgeInsets.all(15.0), - shape: CircleBorder(), ), - )), - Container( - child: RawMaterialButton( - onPressed: () { - LandingPage.isOpenCallPage = false; - 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()); + } + }, ), + // body: isCameraReady + // ? + // : Container( + // height: 200.0, + // width: 200.0, + // color: Colors.green, + // ), + // body: Container( + // decoration: BoxDecoration(color: Colors.grey[700]), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.max, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 30.0), + // alignment: Alignment.center, + // child: Text("Incoming Video Call", textAlign: TextAlign.center, style: TextStyle(fontSize: 26.0, color: Colors.white, letterSpacing: 1.0)), + // ), + // Container( + // alignment: Alignment.center, + // margin: EdgeInsets.fromLTRB(50.0, 30.0, 50.0, 20.0), + // child: Image.asset('assets/images/new-design/hmg_full_logo_hd_white.png'), + // ), + // Container( + // margin: EdgeInsets.fromLTRB(30.0, 10.0, 30.0, 0.0), + // child: Divider( + // color: Colors.white, + // thickness: 1.0, + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 20.0), + // alignment: Alignment.center, + // child: Text("Dr Eyad Ismail Abu Jayab", textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, letterSpacing: 0.8, color: Colors.white)), + // ), + // Container( + // margin: EdgeInsets.only(top: 10.0), + // alignment: Alignment.center, + // child: Text("ENT Clinic", textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, letterSpacing: 0.8, color: Colors.white)), + // ), + // Container( + // margin: EdgeInsets.only(top: 10.0), + // alignment: Alignment.center, + // child: Text("Speciality", textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, letterSpacing: 0.8, color: Colors.white)), + // ), + // Container( + // decoration: BoxDecoration( + // color: Colors.grey[900].withOpacity(0.8), + // borderRadius: BorderRadius.all(Radius.circular(10.0)), + // ), + // padding: EdgeInsets.all(20.0), + // margin: EdgeInsets.only(top: 20.0), + // child: Column( + // children: [ + // Text("Appointment Information", textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, letterSpacing: 1.0, color: Colors.white)), + // Container( + // margin: EdgeInsets.only(top: 20.0), + // child: Text("Sun, 15th Dec, 2019, 09:00", textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, letterSpacing: 1.0, color: Colors.white)), + // ), + // Container( + // margin: EdgeInsets.only(top: 20.0), + // child: Text("ENT Clinic", textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, letterSpacing: 1.0, color: Colors.white)), + // ), + // ], + // ), + // ), + // Container( + // margin: EdgeInsets.only(top: 100.0), + // alignment: Alignment.center, + // child: Row( + // mainAxisSize: MainAxisSize.max, + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // children: [ + // 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: () { + // LandingPage.isOpenCallPage = false; + // 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(), + // ), + // ), + // ], + // ), + // ), + // ], + // )), ); } void _runAnimation() async { + final cameras = await availableCameras(); + final firstCamera = cameras[1]; + + _controller = CameraController( + // Get a specific camera from the list of available cameras. + firstCamera, + // Define the resolution to use. + ResolutionPreset.medium, + ); + _initializeControllerFuture = _controller.initialize(); + + setState(() { + isCameraReady = true; + }); + setAudioFile(); for (int i = 0; i < 100; i++) { await _animationController.forward(); diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index 2c47b3c7..4f0a86fc 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -1,18 +1,22 @@ import 'package:circular_countdown_timer/circular_countdown_timer.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class LiveCarePendingRequest extends StatefulWidget { ErRequestHistoryList pendingERRequestHistoryList; final Function getLiveCareHistory; - LiveCarePendingRequest( - {@required this.getLiveCareHistory, this.pendingERRequestHistoryList}); + LiveCarePendingRequest({@required this.getLiveCareHistory, this.pendingERRequestHistoryList}); @override _LiveCarePendingRequestState createState() => _LiveCarePendingRequestState(); @@ -27,136 +31,197 @@ class _LiveCarePendingRequestState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300]), - borderRadius: BorderRadius.circular(10), - color: Colors.white, - shape: BoxShape.rectangle, - ), - margin: EdgeInsets.all(15.0), + margin: EdgeInsets.fromLTRB(21, 21, 21, 12), padding: EdgeInsets.all(10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, - children: [ - Container( - child: Text("In Progress:", - style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - Container( - alignment: Alignment.center, - margin: EdgeInsets.only(top: 10.0), - child: Text("Estimated Waiting Time: ", - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), - ), - Container( - transform: Matrix4.translationValues(0.0, -50.0, 0.0), - alignment: Alignment.center, - child: CircularCountDownTimer( - duration: - widget.pendingERRequestHistoryList.watingtimeInteger * 60, - width: MediaQuery.of(context).size.width / 3, - height: MediaQuery.of(context).size.height / 3, - color: Colors.white, - fillColor: Colors.green[700], - strokeWidth: 15.0, - textStyle: TextStyle( - fontSize: 22.0, - color: Colors.black87, - fontWeight: FontWeight.bold), - isReverse: true, - isTimerTextShown: true, - onComplete: () { - print('Countdown Ended'); - }, - ), - ), - Container( - transform: Matrix4.translationValues(0.0, -60.0, 0.0), - child: Divider( - color: Colors.grey[500], - thickness: 0.7, - ), - ), + children: [ Container( - transform: Matrix4.translationValues(0.0, -50.0, 0.0), - child: Text("Requested date:", - style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), - ), - Container( - transform: Matrix4.translationValues(0.0, -30.0, 0.0), - child: Text( - DateUtil.getDateFormatted( - widget.pendingERRequestHistoryList.arrivalTime), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), - ), - Container( - transform: Matrix4.translationValues(0.0, -20.0, 0.0), - padding: EdgeInsets.all(7.0), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.red[800], - ), - margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - child: Text(widget.pendingERRequestHistoryList.stringCallStatus, - style: TextStyle(fontSize: 14.0, color: Colors.white)), - ), - Container( - transform: Matrix4.translationValues(0.0, 0.0, 0.0), - child: Divider( - color: Colors.grey[500], - thickness: 0.7, + width: MediaQuery.of(context).size.width, + decoration: cardRadius(15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.fromLTRB(16, 21, 16, 23), + child: Text(TranslationBase.of(context).waitingTime, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), + ), + Container( + height: MediaQuery.of(context).size.height * 0.25, + transform: Matrix4.translationValues(0.0, -10.0, 0.0), + alignment: Alignment.center, + child: CircularCountDownTimer( + duration: widget.pendingERRequestHistoryList.watingtimeInteger * 60, + width: MediaQuery.of(context).size.width / 2, + height: MediaQuery.of(context).size.height / 2, + color: Colors.white, + fillColor: CustomColors.green, + strokeWidth: 7.0, + textStyle: TextStyle(fontSize: 32.0, color: Color(0xff2E303A), fontWeight: FontWeight.w400), + isReverse: true, + isTimerTextShown: true, + onComplete: () { + print('Countdown Ended'); + }, + ), + ), + ], ), ), Container( - alignment: Alignment.center, - transform: Matrix4.translationValues(0.0, 10.0, 0.0), - child: Text( - "Your turn is after " + - widget.pendingERRequestHistoryList.patCount.toString() + - " Patients", - style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - Container( - transform: Matrix4.translationValues(0.0, 110.0, 0.0), - alignment: Alignment.bottomCenter, + margin: const EdgeInsets.fromLTRB(0, 12, 0, 0), + padding: const EdgeInsets.fromLTRB(16, 21, 16, 12), width: MediaQuery.of(context).size.width, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - elevation: 0, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - cancelLiveCareRequest(); - }, - child: Text(TranslationBase.of(context).cancel, - style: TextStyle(fontSize: 18.0)), - ), + decoration: cardRadius(15.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: cardRadius(15.0, color: Color(0xffCC9B14)), + padding: const EdgeInsets.all(5.0), + child: Text(widget.pendingERRequestHistoryList.stringCallStatus, style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4)), + ), + Container( + padding: const EdgeInsets.all(5.0), + child: MyRichText(TranslationBase.of(context).requestedDateLiveCare, + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.pendingERRequestHistoryList.arrivalTime)), projectViewModel.isArabic), + ), + Container( + padding: const EdgeInsets.all(5.0), + child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList.patCount.toString() + " " + TranslationBase.of(context).patients, + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), + ), + // Container( + // child: DefaultButton(TranslationBase.of(context).cancel, () { + // cancelLiveCareRequest(); + // }), + // ), + ], ), ), ], ), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + // children: [ + // Container( + // child: Text("In Progress:", + // style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + // ), + // Container( + // alignment: Alignment.center, + // margin: EdgeInsets.only(top: 10.0), + // child: Text("Estimated Waiting Time: ", + // style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, -50.0, 0.0), + // alignment: Alignment.center, + // child: CircularCountDownTimer( + // duration: + // widget.pendingERRequestHistoryList.watingtimeInteger * 60, + // width: MediaQuery.of(context).size.width / 3, + // height: MediaQuery.of(context).size.height / 3, + // color: Colors.white, + // fillColor: Colors.green[700], + // strokeWidth: 15.0, + // textStyle: TextStyle( + // fontSize: 22.0, + // color: Colors.black87, + // fontWeight: FontWeight.bold), + // isReverse: true, + // isTimerTextShown: true, + // onComplete: () { + // print('Countdown Ended'); + // }, + // ), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, -60.0, 0.0), + // child: Divider( + // color: Colors.grey[500], + // thickness: 0.7, + // ), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, -50.0, 0.0), + // child: Text("Requested date:", + // style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, -30.0, 0.0), + // child: Text( + // DateUtil.getDateFormatted( + // widget.pendingERRequestHistoryList.arrivalTime), + // style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, -20.0, 0.0), + // padding: EdgeInsets.all(7.0), + // decoration: BoxDecoration( + // shape: BoxShape.rectangle, + // borderRadius: BorderRadius.all(Radius.circular(5)), + // color: Colors.red[800], + // ), + // margin: EdgeInsets.only(top: 5.0, bottom: 5.0), + // child: Text(widget.pendingERRequestHistoryList.stringCallStatus, + // style: TextStyle(fontSize: 14.0, color: Colors.white)), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, 0.0, 0.0), + // child: Divider( + // color: Colors.grey[500], + // thickness: 0.7, + // ), + // ), + // Container( + // alignment: Alignment.center, + // transform: Matrix4.translationValues(0.0, 10.0, 0.0), + // child: Text( + // "Your turn is after " + + // widget.pendingERRequestHistoryList.patCount.toString() + + // " Patients", + // style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), + // ), + // Container( + // transform: Matrix4.translationValues(0.0, 110.0, 0.0), + // alignment: Alignment.bottomCenter, + // width: MediaQuery.of(context).size.width, + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // minWidth: MediaQuery.of(context).size.width, + // height: 45.0, + // child: RaisedButton( + // color: Colors.red[800], + // textColor: Colors.white, + // elevation: 0, + // disabledTextColor: Colors.white, + // disabledColor: new Color(0xFFbcc2c4), + // onPressed: () { + // cancelLiveCareRequest(); + // }, + // child: Text(TranslationBase.of(context).cancel, + // style: TextStyle(fontSize: 18.0)), + // ), + // ), + // ), + // ], + // ), ); } cancelLiveCareRequest() { LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service - .cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context) - .then((res) { + service.cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast( - message: "LiveCare request cancelled successfully"); + AppToast.showSuccessToast(message: "LiveCare request cancelled successfully"); widget.getLiveCareHistory(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart index e9b1dfb6..1343f479 100644 --- a/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_history_details_page.dart @@ -21,7 +21,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPrescriptionReportDetailsRC(), + onModelReady: (model) => model.getPrescriptionReportDetailsRC(prescriptionsOrder.iD, projectViewModel.user.patientID), builder: (_, model, widget) { int status = prescriptionsOrder.statusId; String _statusDisp = prescriptionsOrder.statusText; diff --git a/lib/routes.dart b/lib/routes.dart index 9525bc96..ab92ee53 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/TestPage.dart'; import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/forgot-password.dart'; @@ -51,6 +52,7 @@ const String TEST_PAGE = 'test-page'; const String OPENTOK_CALL_PAGE = 'OPENTOK_CALL_PAGE'; const String CART_ORDER_PAGE = 'cart-order-page'; const String CALL_PAGE = 'CALL_PAGE'; +const String INCOMING_CALL_PAGE = 'INCOMING_CALL_PAGE'; const String HEALTH_WEATHER = 'health-weather'; const APP_UPDATE = 'app-update'; @@ -80,6 +82,7 @@ var routes = { SETTINGS: (_) => Settings(), CART_ORDER_PAGE: (_) => CartOrderPage(), CALL_PAGE: (_) => CallPage(), + INCOMING_CALL_PAGE: (_) => IncomingCall(), OPENTOK_CALL_PAGE: (_) => OpenTokConnectCallPage( apiKey: '46209962', sessionId: '1_MX40NjIwOTk2Mn5-MTYzNDY0ODM3NDY2Nn5PcnpnNGM0R1Q3ODZ6UXlFQ01lMDF5YWJ-fg', diff --git a/lib/uitl/navigation_service.dart b/lib/uitl/navigation_service.dart index d4cd426b..3e720dea 100644 --- a/lib/uitl/navigation_service.dart +++ b/lib/uitl/navigation_service.dart @@ -4,6 +4,8 @@ class NavigationService { final GlobalKey navigatorKey = new GlobalKey(); + static NavigationService instance = NavigationService(); + Future navigateTo(String routeName) { return navigatorKey.currentState.pushNamed(routeName); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 9484c69d..69b45410 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2801,6 +2801,9 @@ class TranslationBase { String get points => localizedValues["points"][locale.languageCode]; String get availableBalance => localizedValues["availableBalance"][locale.languageCode]; String get ordersDashboard => localizedValues["ordersDashboard"][locale.languageCode]; + String get requestedDateLiveCare => localizedValues["requestedDateLiveCare"][locale.languageCode]; + String get yourTurn => localizedValues["yourTurn"][locale.languageCode]; + String get patients => localizedValues["patients"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 5ae0d119..158de780 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -28,15 +28,15 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; - // static String SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 23a6dd9b..65a77132 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -253,7 +253,7 @@ class productTile extends StatelessWidget { : Container(), // this.isOrderDetails == true && model.order[0].orderStatusId == 30? - if (status == 30 && this.isOrderDetails == true) + if (status == 30 || status == 997 && this.isOrderDetails == true) Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index 73edbe08..9a3ff303 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -48,6 +48,7 @@ class PickupLocationFromMap extends StatelessWidget { autocompleteLanguage: projectViewModel.currentLanguage, enableMapTypeButton: true, selectInitialPosition: true, + region: "SA", onPlacePicked: (PickResult result) { print(result.adrAddress); onPick(result); diff --git a/pubspec.yaml b/pubspec.yaml index 744929f6..ff6873fc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,6 +35,9 @@ dependencies: #chart fl_chart: ^0.12.3 + #Camera Preview + camera: ^0.7.0+4 + # Permissions permission_handler: ^5.1.0+2