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..babdd9c1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1082,7 +1082,7 @@ const Map localizedValues = { "removeFromWishlist": {"en": "Remove From Wishlist", "ar": "احذف للمفضلة"}, "noData": {"en": "There is no data", "ar": "لايوجد بيانات"}, "no_data": {"en": "No data", "ar": "لايوجد بيانات"}, - "buyNow": {"en": "buy now", "ar": "إشتري الان"}, + "buyNow": {"en": "Buy Now", "ar": "إشتري الان"}, "quantityShortcut": {"en": "QTY", "ar": "كمية"}, "pharmacyServiceTermsCondition": {"en": "I agree with the terms of service and I adhere to them unconditionally", "ar": " موافق على شروط الخدمة وألتزم بها دون قيد أو شرط"}, "Year": {"en": "YEAR", "ar": "السنة"}, @@ -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/pages/pharmacies/screens/product-details/details_info.dart b/lib/pages/pharmacies/screens/product-details/details_info.dart index bc5e7f80..e7a7f663 100644 --- a/lib/pages/pharmacies/screens/product-details/details_info.dart +++ b/lib/pages/pharmacies/screens/product-details/details_info.dart @@ -22,33 +22,34 @@ class DetailsInfo extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - child: Texts( - TranslationBase.of(context) - .description, - fontSize: 17, - color: Colors.grey, - ), - ), +// Container( +// child: Texts( +// TranslationBase.of(context) +// .description, +// fontSize: 17, +// color: Colors.grey, +// ), +// ), +// SizedBox( +// height: 10, +// ), +// Divider(height: 1, color: Colors.grey), SizedBox( height: 10, ), - Divider(height: 1, color: Colors.grey), - SizedBox( - height: 15, - ), Container( - child: Texts( + margin: EdgeInsets.only(left: 10, right: 10), + child: Text( projectViewModel.isArabic ? product.fullDescriptionn : product .fullDescription ?? "", - fontSize: 16, + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.56), ), ), SizedBox( - height: 20, + height: 60, ), ]), ); diff --git a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart index abe3328b..e0cf8168 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -79,10 +80,11 @@ class _FooterWidgetState extends State { children: [ Padding( padding: const EdgeInsets.all(8.0), - child: Text( - TranslationBase.of(context).quantity, - style: TextStyle( - fontSize: 15, fontWeight: FontWeight.bold), + child: Texts( + TranslationBase.of(context).productQuantity, + fontSize: 15, + fontWeight: FontWeight.bold, + color: Color(0xFF575757) ), ), InkWell( @@ -144,7 +146,7 @@ class _FooterWidgetState extends State { ), ) : Container( - height: 20, + height: 10, ), Container( height: 58, @@ -164,23 +166,25 @@ class _FooterWidgetState extends State { AppText( TranslationBase.of(context).productQuantity, fontSize: 10, - + fontWeight: FontWeight.w600, ), Row( - children: [ AppText( widget.quantity.toString(), fontSize: 16, fontWeight: FontWeight.bold, - ), + ), SizedBox( width: 20, ), - Icon(Icons.keyboard_arrow_down,color: Color(0xFF2E303A),size: 25,) + Icon( + Icons.keyboard_arrow_down, + color: Color(0xFF2E303A), + size: 25, + ) ], ), - ], ), SizedBox( @@ -216,10 +220,11 @@ class _FooterWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: SecondaryButton( - label: TranslationBase.of(context).addToCart.toUpperCase(), + label: TranslationBase.of(context).addToCart, disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx, + fontSize: 16, onTap: () async { if (!authenticatedUserObject.isLogin) { login(); @@ -232,7 +237,7 @@ class _FooterWidgetState extends State { fontWeight: FontWeight.w600, borderColor: Color(0xFF4CAF50).withOpacity(0.7), borderRadius: 6, - color: Color(0xFF5AB145).withOpacity(0.7), + color: Color(0xFF535353), ), ), SizedBox( @@ -241,7 +246,8 @@ class _FooterWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: SecondaryButton( - label: TranslationBase.of(context).buyNow.toUpperCase(), + label: TranslationBase.of(context).buyNow, + fontSize: 16, disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx, @@ -263,7 +269,7 @@ class _FooterWidgetState extends State { widget.quantity > widget.quantityLimit || widget.item.isRx ? Color(0xFF535353).withOpacity(0.7) - : Colors.grey[800], + : Color(0xFF5AB145), ), ), ], diff --git a/lib/pages/pharmacies/screens/product-details/product-detail.dart b/lib/pages/pharmacies/screens/product-details/product-detail.dart index acbdb0a3..52c1d64d 100644 --- a/lib/pages/pharmacies/screens/product-details/product-detail.dart +++ b/lib/pages/pharmacies/screens/product-details/product-detail.dart @@ -136,7 +136,7 @@ class __ProductDetailPageState extends State { if(model.isStockAvailable!= null && !model.isStockAvailable) Container( height: MediaQuery.of(context).size.height * .40, - color: Colors.white.withOpacity(0.75), + color: Colors.white.withOpacity(0.6), // child: AppText("Out of Stock"), ), if(model.isStockAvailable!= null && !model.isStockAvailable) @@ -150,7 +150,7 @@ class __ProductDetailPageState extends State { // color: Colors.white.withOpacity(0.75), child: RotationTransition( turns: new AlwaysStoppedAnimation(310 / 360), - child: AppText(TranslationBase.of(context).productOutOfStock ,color:Color(0xFF000000).withOpacity(0.1),fontSize: projectViewModel.isArabic?40: 50, fontWeight: FontWeight.bold ,)), + child: AppText(TranslationBase.of(context).productOutOfStock ,color:Color(0xFF000000).withOpacity(0.19),fontSize: projectViewModel.isArabic?40: 50, fontWeight: FontWeight.bold ,)), ), ), ), @@ -233,7 +233,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).details, - style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14), + style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), ), color: Colors.white, ), @@ -264,7 +264,7 @@ class __ProductDetailPageState extends State { }, child: Text( TranslationBase.of(context).reviews, - style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14), + style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), ), color: Colors.white, ), @@ -294,7 +294,7 @@ class __ProductDetailPageState extends State { : null, child: Text( TranslationBase.of(context).availability, - style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14), + style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), ), color: Colors.white, ), diff --git a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart index 21bff3c3..3a6f5c8d 100644 --- a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart +++ b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart @@ -81,13 +81,14 @@ class _ProductNameAndPriceState extends State { // regular: true, fontSize: 17, fontWeight: FontWeight.w600, + letterSpacing:-0.68 // textAlign: TextAlign.center, )), ], )) : Container(), FractionallySizedBox( - widthFactor: 0.95, + widthFactor: 0.93, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -105,18 +106,23 @@ class _ProductNameAndPriceState extends State { ), color: getStatusBackgroundColor(), borderRadius: BorderRadius.circular(30.0)), - child: Text( - widget.stockAvailability, - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 11, - color: Color(0xffFFFFFF), - ), - //color: widget.isStockAvailable ? Colors.white : Colors.red, - ), + // child: Text( + // widget.stockAvailability, + // style: TextStyle( + // fontWeight: FontWeight.w600, + // fontSize: 11, + // color: Color(0xffFFFFFF), + // ), + // color: getStatusBackgroundColor(), + // borderRadius: BorderRadius.circular(30.0)), + child: Text( + widget.stockAvailability, + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),letterSpacing:-0.44)), + //color: widget.isStockAvailable ? Colors.white : Colors.red, ), // SizedBox(width: 20), - if (widget.authenticatedUserObject.isLogin) + if ( + widget.authenticatedUserObject.isLogin) widget.stockAvailability != null && !widget.isStockAvailable && widget.customerId != null @@ -202,9 +208,9 @@ class _ProductNameAndPriceState extends State { ), Padding( padding: - const EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 15), + const EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 12), child: Container( - margin: EdgeInsets.only(left: 5, right: 5), + margin: EdgeInsets.only(left: 10, right: 10), child: Align( alignment: projectViewModel.isArabic ? Alignment.topRight @@ -213,7 +219,10 @@ class _ProductNameAndPriceState extends State { projectViewModel.isArabic ? widget.item.namen : widget.item.name, - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 16, + letterSpacing: -0.96), ), ), ), @@ -221,7 +230,7 @@ class _ProductNameAndPriceState extends State { Padding( padding: const EdgeInsets.only(left: 8, right: 8), child: Container( - margin: EdgeInsets.only(left: 5, right: 5), + margin: EdgeInsets.only(left: 10, right: 10), child: Align( alignment: projectViewModel.isArabic ? Alignment.topRight @@ -230,7 +239,10 @@ class _ProductNameAndPriceState extends State { TranslationBase.of(context).sar + " " + widget.item.price.toString(), - style: TextStyle(fontWeight: FontWeight.bold, fontSize: 19), + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 19, + letterSpacing: -0.76), ), ), ), @@ -240,6 +252,7 @@ class _ProductNameAndPriceState extends State { child: Row( children: [ Container( + margin: EdgeInsets.only(left: 8, right: 8), child: Align( alignment: Alignment.bottomLeft, child: Row( @@ -256,16 +269,16 @@ class _ProductNameAndPriceState extends State { emptyIcon: Icons.star_border, ), SizedBox( - width: 10, + width: 5, ), // Texts( // "${widget.item.approvedRatingSum}", // fontWeight: FontWeight.bold, // fontSize: 12, // ), - SizedBox( - width: 30, - ), +// SizedBox( +// width: 30, +// ), Text( "(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})", style: TextStyle( @@ -291,7 +304,7 @@ class _ProductNameAndPriceState extends State { ), ), SizedBox( - height: 30, + height: 20, ), ], ), diff --git a/lib/pages/pharmacies/screens/product-details/reviews_info.dart b/lib/pages/pharmacies/screens/product-details/reviews_info.dart index e3050927..c4526790 100644 --- a/lib/pages/pharmacies/screens/product-details/reviews_info.dart +++ b/lib/pages/pharmacies/screens/product-details/reviews_info.dart @@ -41,8 +41,8 @@ class ReviewsInfo extends StatelessWidget { // .reviews[index].customerId // .toString(), style: TextStyle( - fontSize: 17, - color: Colors.grey, + fontSize: 14, + color: Colors.black, fontWeight: FontWeight.w600), ), ), @@ -83,10 +83,10 @@ class ReviewsInfo extends StatelessWidget { ), ); }, - ) + ) : Container( padding: EdgeInsets.fromLTRB(15,15,15,20), - margin: EdgeInsets.only(bottom: 20), + margin: EdgeInsets.only(bottom: 40), alignment: Alignment.center, child: Text( TranslationBase.of(context).noReviewsAvailable, diff --git a/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart b/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart index f2406614..a78f04b8 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart @@ -1,15 +1,20 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class IconWithBg extends StatelessWidget { final IconData icon; final Color color; final Function onPress; + final bool hasPadding; - const IconWithBg({Key key, this.icon, this.color, this.onPress}) + IconWithBg( + {Key key, this.icon, this.color, this.onPress, this.hasPadding = false}) : super(key: key); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( width: 40, height: 40, @@ -18,12 +23,21 @@ class IconWithBg extends StatelessWidget { borderRadius: BorderRadius.circular(30), ), child: Center( - child: IconButton( - icon: Icon(icon, size: 20,), - color: color, - onPressed: () async { - onPress(); - }, + child: Padding( + padding: EdgeInsets.only( + left: !projectViewModel.isArabic ? (hasPadding ? 4 : 0) : 0, + right: projectViewModel.isArabic ? (hasPadding ? 4 : 0) : 0 + ), + child: IconButton( + icon: Icon( + icon, + size: 20, + ), + color: color, + onPressed: () async { + onPress(); + }, + ), ), )); } diff --git a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart index ca59a0fb..d40f222b 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; @@ -57,10 +56,12 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - // mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ IconWithBg( icon: Icons.arrow_back_ios, + hasPadding: true, color: Color(0xFF2B353E), onPress: () { Navigator.pop(context); 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/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index e62a4a3b..8f0ae5f1 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -30,7 +30,7 @@ class SecondaryButton extends StatefulWidget { this.noBorderRadius = false, this.borderRadius, this.disableColor, - this.fontWeight}) + this.fontWeight, this.fontSize}) : super(key: key); final String label; @@ -47,6 +47,7 @@ class SecondaryButton extends StatefulWidget { final double borderRadius; final Color disableColor; final FontWeight fontWeight; + final double fontSize; @override @@ -247,7 +248,7 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 14.0, + fontSize: widget.small ? 12.0 : widget.fontSize??14.0, fontWeight: FontWeight.w700, fontFamily: projectViewModel.isArabic ? 'Cairo' 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