From cf27c3e796c40393aa3ed77d95a1324e17008122 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 Nov 2021 17:41:00 +0300 Subject: [PATCH 01/11] Incoming call & LiveCare pending UI revamped --- assets/images/new/logo.png | Bin 0 -> 6505 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 4 +- lib/main.dart | 6 +- lib/pages/landing/landing_page.dart | 12 + lib/pages/livecare/incoming_call.dart | 367 +++++++++++++----- .../widgets/LiveCarePendingRequest.dart | 287 ++++++++------ lib/routes.dart | 3 + lib/uitl/navigation_service.dart | 2 + lib/uitl/translations_delegate_base.dart | 3 + lib/widgets/in_app_browser/InAppBrowser.dart | 12 +- pubspec.yaml | 3 + 12 files changed, 483 insertions(+), 220 deletions(-) create mode 100644 assets/images/new/logo.png diff --git a/assets/images/new/logo.png b/assets/images/new/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..29719b35936faa70f760fbfde6456629ac401f29 GIT binary patch literal 6505 zcmbVR2{=@3`#+XsOEZxOHHL(2Gqy~P?0Z7ith14I24l-Ik}M@#mbBPqi!6z($(l8y zNVX^@JIT&}v|aD_|K4x8zPYY5=RD8zyZ8IKpZi=VTu)d15aV%1000hYYN!}c?i2eL zJssuWD>6fea$_K9n7IQ06YKs(1>Aqg0RRUk>3X4bM#Jrse6f^*w zzu-+kVH|Np2pVT+?}CIbRMkNt_E;p;MEat{MS?Q!s=dZFH{9iGx`vo*ju<&C^nyI( zyf=cvz!^tGLA;%vT-*`fNazo~2+H&Rv^W&<1448}LKXJ~LQF5}L6q@sIEb{Ej3@>s zbrvEkCkB&|l8}@UfxsnTa^eza#bJ`75-@~>3_@BK^6LksNOQy5A`Dd2e#xSYkkG3{ zA^{;T?&akr<|QeHce4|R$;nZ8z{TNkQ3^uT-N%K9@)mV*=ljh;1?P@&vnLSk@h*^k zjwm$VgNTGuH2rCUGvN?r z3(=i|h5f-2uHuP!_pA7S!TQhgKM0_>_Tt4qGX7Qj!Mdjd<5~7kgIS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=i0Gj z!KY7DIgdXvNw9wz3_J`$KIR4b7f0S)ZaYhsVi8Gax+j36En3*YFmIJdyG}B3%CNyT z1dJF00ln)m4zHfiH!!zN?g$|bn(XyFD&hKJK4lKXBxPp2pcjCsDNIXRgsCrh!Fc5bWhF_2M2zwzBi%-fG(Z P#}G|bU6n#5o1p&#+wM@@ literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index c4fabca6..92cafb4b 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 94e7349f..3caf6c6b 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": "غرام في اليوم"}, @@ -1734,4 +1734,6 @@ const Map localizedValues = { "points": {"en": "Points", "ar": "نقاط"}, "availableBalance": {"en": "Available Balance", "ar": "الرصيد المتوفر"}, "ordersDashboard": {"en": "My Orders", "ar": "طلباتي"}, + "yourTurn": {"en": "your turn is after", "ar": "دورك بعد"}, + "patients": {"en": "patients", "ar": "مرضي"}, }; 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/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 4a5c8a5d..fb771199 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2799,6 +2799,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/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 From d6eeb02c913f7407e642a4a54158f5ab2895bafb Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 24 Nov 2021 17:30:00 +0200 Subject: [PATCH 02/11] fix on design --- lib/config/localized_values.dart | 2 +- .../product-details/footor/footer-widget.dart | 34 +++++++++++-------- .../product-details/product-detail.dart | 4 +-- .../product-details/shared/icon_with_bg.dart | 28 +++++++++++---- .../shared/product_details_app_bar.dart | 5 +-- lib/widgets/buttons/secondary_button.dart | 5 +-- 6 files changed, 50 insertions(+), 28 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index aa9c5b16..77a81ddf 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": "السنة"}, 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..49e295ea 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 ,)), ), ), ), 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/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' From 75423e550137a5bb6dc93a54835991a026181529 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 25 Nov 2021 09:36:02 +0300 Subject: [PATCH 03/11] Updates --- .../images/pharmacy_module/payment/applePay.png | Bin 0 -> 11172 bytes .../service/PrescriptionDeliveryService.dart | 2 +- .../service/medical/prescriptions_service.dart | 4 ++-- .../parmacyModule/order-preview-service.dart | 3 +++ .../medical/prescriptions_view_model.dart | 4 ++-- .../pharmacyModule/OrderPreviewViewModel.dart | 2 ++ .../prescriptions_history_details_page.dart | 2 +- lib/widgets/pharmacy/product_tile.dart | 2 +- .../pickupLocation/PickupLocationFromMap.dart | 1 + 9 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 assets/images/pharmacy_module/payment/applePay.png diff --git a/assets/images/pharmacy_module/payment/applePay.png b/assets/images/pharmacy_module/payment/applePay.png new file mode 100644 index 0000000000000000000000000000000000000000..fd167e1cbc4137579b849ae5fda13c497babbe61 GIT binary patch literal 11172 zcmeHtg;!k9wr1lJoL~VGT!ROKyEQZp3GNOJ1PSi$1Z~_c5FA2q2ofa0J-EBO&Ea?N zd+)B9HS-tDSyWeb)!w^KeR~&F?T>I}MHx)=SLh%R2oo$TsR{zYL4fugDl+i-o6fTy z1VW#+l8{gaOGr>CJKCFD*_wesvf)W7D9UO(gnmz+;}YU8C@5&pW1Qh-(Q<=X$t7uN z{Dbg}#g%bLYZ?P=#H0`t3G@h599aBja9%V>bq06`zD3_{(yYogw_nEneD&MYelhjN zsf~~CiSeoRY3K(iPC`@M2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p6p=N8SJdh40_A!+ZGz@E@=4A0Is3R=R=*+y#m^ z=;|QUaCoxOq6^OVBe@cQ*^k!jL;C=AwEOpmQ_|zvrV{NdJ0Kus{rsTL?t4=#E(de< zBGf}~M0`qGJ+GMFmPHMl{uAnPqC<$gJ_`u#pZ8~S7u&qc9&fg?0ZH4q(hA)ld54Rw zIy>)+HXGrBXrrH@QKc}vJK*(d@w%xQ$f6rq_+7lNd3U~(FyQmC;+Zb6XMgb5H1_xt zI;-Felm3Ttng4~?Mg~wULcWiJZ_HLbSz*LRSjY$$>;3pHx93&`)31&)rdL;_0YGB# zOYWqUs&^|5+W$zY6+>|$G^<^k2lL-AE(Z!$%4 zlRtNQnuOhsbDX*Ej}luN*S=88oa$`%)HS(;(d#3ioCK{12m^q_;mu&dYvW8$O`Wcu zC^soOl@0?8+T_nrZ29J7X_yB#Wb|LYlYwu9SaGhQsvU(9S*><4{Im31QP5F~*VUn3 zeObHD!>iS4VU5qb6O6JfBBmY0h8Q&D2(x?hUrmqgn{Jyw)W!>C^9{Y8gS;YCLKkG@ zM7||K7~!$Zh};O!dfzpX>UDi=1QY7u8_M!1c5p1{1Pn;NK^Wn*d{y^*lF9y7U19a4 zHwL)9Z4KM5lF+_-W+l5NmjNb<>CV7>7od-BhRJDNDqD9<2Db-O*meQt3H=FwdvCgO z7a$}H3t6!308WSkE*tT9iQM&Iu24D!X8-{Os|4V^-m}{Ir3oBu)p_!;2; z8YWR|>7%yko+nyIJS9SPa_+YT5Tk$-fICrm 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/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/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); From 3c971223088b7cc91eb2167a238b4301b1248f89 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Nov 2021 09:41:23 +0200 Subject: [PATCH 04/11] pharmacy home dsign --- lib/pages/landing/landing_page_pharmcy.dart | 7 +- .../screens/pharmacy_module_page.dart | 2 +- .../pharmacies/widgets/ProductTileItem.dart | 369 +++++++++--------- .../widgets/home/BestSellerWidget.dart | 2 +- .../widgets/home/MostViewedWidget.dart | 7 +- .../widgets/home/RecentlyViewedWidget.dart | 2 +- .../widgets/home/ViewAllHomeWidget.dart | 3 +- 7 files changed, 205 insertions(+), 187 deletions(-) diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index c90a317a..05c20dd8 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -90,7 +90,9 @@ class _LandingPagePharmacyState extends State { try { String barcode = result; GifLoaderDialogUtils.showMyDialog(context); - await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { + await BaseAppClient() + .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", + onSuccess: (dynamic response, int statusCode) { print(response); var product = PharmacyProduct.fromJson(response["products"][0]); GifLoaderDialogUtils.hideDialog(context); @@ -100,7 +102,8 @@ class _LandingPagePharmacyState extends State { AppToast.showErrorToast(message: "Product not found"); }); } catch (apiEx) { - AppToast.showErrorToast(message: "Something went wrong, please try again"); + AppToast.showErrorToast( + message: "Something went wrong, please try again"); } } catch (barcodeEx) {} } diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index 1f90f454..8f500064 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -48,7 +48,7 @@ class _PharmacyPageState extends State { isMainPharmacyPages: true, isPharmacy: true, isShowPharmacyAppbar: true, - backgroundColor: Colors.white, + backgroundColor: Color(0xffFEFEFE), body: Container( width: double.infinity, child: SingleChildScrollView( diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index fcdb0ad6..f16aca03 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -77,202 +77,210 @@ class ProductTileItem extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); - return InkWell( - onTap: () => productOnClick(context), - splashColor: Theme.of(context).primaryColor, - child: Container( - margin: EdgeInsets.all(7), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade300, width: 0.5), - borderRadius: BorderRadius.circular(8)), - padding: EdgeInsets.symmetric(horizontal: 4), - width: MediaQuery.of(context).size.width / 2.8, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Stack( - // children: [ - // Container( - // margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - // alignment: Alignment.center, - // child: (item.images != null && item.images.length > 0) - // ? Image.network( - // item.images[0].src, - // fit: BoxFit.cover, - // height: itemHeight / 2, - // ) - // : Image.asset( - // "assets/images/no_image.png", - // fit: BoxFit.cover, - // height: itemHeight / 2, - // ), - // ), - // ], - // ), + return Container( + margin: EdgeInsets.all(7), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey.shade300, width: 0.2), + borderRadius: BorderRadius.circular(10), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0xffF1F1F1), + spreadRadius: 4, + blurRadius: 5.5, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + padding: EdgeInsets.symmetric(horizontal: 4), + width: MediaQuery.of(context).size.width / 2.8, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Stack( + // children: [ + // Container( + // margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + // alignment: Alignment.center, + // child: (item.images != null && item.images.length > 0) + // ? Image.network( + // item.images[0].src, + // fit: BoxFit.cover, + // height: itemHeight / 2, + // ) + // : Image.asset( + // "assets/images/no_image.png", + // fit: BoxFit.cover, + // height: itemHeight / 2, + // ), + // ), + // ], + // ), - Container( + Container( + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.3, + padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), + color: Colors.white, + child: Container( width: double.infinity, - height: MediaQuery.of(context).size.width * 0.3, - padding: - EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14), - color: Colors.white, - child: InkWell( - onTap: () {}, - child: Container( - width: double.infinity, - height: double.infinity, - clipBehavior: Clip.antiAlias, - decoration: containerRadiusWithGradientServices(33, - lightColor: Colors.transparent, - darkColor: Colors.transparent), - child: Stack( - children: [ - Container( - width: double.infinity, - height: double.infinity, - //clipBehavior: Clip.antiAlias, - // decoration: projectProvider.isArabic - // ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) - // : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), - child: Stack( - children: [ - Container( - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - alignment: Alignment.center, - child: (item.images != null && - item.images.length > 0) - ? Image.network( - item.images[0].src, - fit: BoxFit.cover, - height: itemHeight / 2, - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: itemHeight / 2, - ), + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: containerRadiusWithGradientServices(0, + lightColor: Colors.transparent, + darkColor: Colors.transparent), + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + //clipBehavior: Clip.antiAlias, + // decoration: projectProvider.isArabic + // ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) + // : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade300, width: 1.1), + borderRadius: BorderRadius.only( + topRight: Radius.circular( + item.rxMessage != null && + projectProvider.isArabic + ? 20 + : 8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + topLeft: Radius.circular(item.rxMessage != null && + !projectProvider.isArabic + ? 25 + : 8), ), - ], + ), + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + alignment: Alignment.center, + child: (item.images != null && item.images.length > 0) + ? Padding( + padding: EdgeInsets.all(12.0), + child: Image.network( + item.images[0].src, + fit: BoxFit.cover, + height: itemHeight / 2, + ), + ) + : Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: itemHeight / 2, + ), ), - ), - if (item.rxMessage != null) - projectProvider.isArabic - ? Positioned( - right: -16, - top: 2, - child: Transform.rotate( - angle: math.pi / 4, - child: Container( - padding: EdgeInsets.only( - left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, - child: Padding( - padding: EdgeInsets.all(2.0), - child: Text( - "الوصفة\n مطلوبة", - style: TextStyle( - color: Colors.white, - fontSize: 7.5, - height: 0.8, - fontWeight: FontWeight.bold, - letterSpacing: -0.27, - ), - ), + ], + ), + ), + if (item.rxMessage != null) + projectProvider.isArabic + ? Positioned( + right: -16, + top: 2, + child: Transform.rotate( + angle: math.pi / 4, + child: Container( + padding: EdgeInsets.only( + left: 18, right: 18, top: 6, bottom: 3), + color: CustomColors.accentColor, + child: Padding( + padding: EdgeInsets.all(2.0), + child: Text( + "الوصفة\n مطلوبة", + style: TextStyle( + color: Colors.white, + fontSize: 7.5, + height: 0.8, + fontWeight: FontWeight.bold, + letterSpacing: -0.27, ), ), ), - ) - : Positioned( - left: -24, - top: 2, - child: Transform.rotate( - angle: -math.pi / 4, - child: Container( - padding: EdgeInsets.only( - left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, - child: Text( - "\n E-Prescription \n Is required", - style: TextStyle( - color: Colors.white, - fontSize: 7.5, - //letterSpacing: -0.27, - height: 1.2, - fontWeight: FontWeight.w600, - ), - ), + ), + ), + ) + : Positioned( + left: -24, + top: 2, + child: Transform.rotate( + angle: -math.pi / 4, + child: Container( + padding: EdgeInsets.only( + left: 18, right: 18, top: 6, bottom: 3), + color: CustomColors.accentColor, + child: Text( + "\n E-Prescription \n Is required", + style: TextStyle( + color: Colors.white, + fontSize: 7.5, + //letterSpacing: -0.27, + height: 1.2, + fontWeight: FontWeight.w600, ), ), ), - ], - ), - ), + ), + ), + ], ), ), - - // Padding( - // padding: EdgeInsets.fromLTRB(1, 1, 1, 1), - // child: Container( - // width: item.rxMessage != null - // ? MediaQuery.of(context).size.width / 1.0 - // : 0, - // padding: EdgeInsets.fromLTRB(8, 2, 8, 2), - // decoration: BoxDecoration( - // color: Color(0xffb23838), - // ), - // child: item.rxMessage != null - // ? Texts( - // projectProvider.isArabic - // ? item.rxMessagen - // : item.rxMessage, - // color: Colors.white, - // regular: true, - // fontSize: 10, - // fontWeight: FontWeight.w400, - // ) - // : Texts(""), - // ), - // ), - // SizedBox(height: 4,), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 4.0), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.075, child: Texts( projectProvider.isArabic ? item.namen : item.name, - regular: true, - fontSize: 12, - fontWeight: FontWeight.w400, + //regular: true, + fontSize: 10, + color: Color(0xff2B353E), + fontWeight: FontWeight.w500, ), ), - Expanded( - child: Container( - margin: EdgeInsets.symmetric( - horizontal: 4, - vertical: 0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsets.only(top: 2, bottom: 2), - child: Texts( - "SAR ${item.price}", - fontWeight: FontWeight.w600, - fontSize: 14, - ), + ), + SizedBox( + height: 7.0, + ), + Expanded( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: 4, + vertical: 0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 10, vertical: 2), + child: Texts( + "SAR ${item.price}", + fontWeight: FontWeight.bold, + fontSize: 11, + color: Color(0xff2B353E), ), - Row( + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 5), + child: Row( children: [ // Expanded( RatingBar.readOnly( initialRating: item.approvedRatingSum.toDouble(), size: 15.0, - filledColor: Color(0xffD02127), - emptyColor: Colors.grey[500], + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), isHalfAllowed: true, halfFilledIcon: Icons.star_half, filledIcon: Icons.star, - emptyIcon: Icons.star, + emptyIcon: Icons.star_border, ), Texts( "(${item.approvedTotalReviews})", @@ -282,11 +290,12 @@ class ProductTileItem extends StatelessWidget { ), SizedBox( - width: 20.0, + width: 10.0, ), Icon( Icons.arrow_forward, - size: 18, + size: 15, + color: Color(0xff2D2F39), ), // StarRating( @@ -299,15 +308,15 @@ class ProductTileItem extends StatelessWidget { // ), ], ), - ], - ), + ), + ], ), ), - SizedBox( - height: 5, - ), - ], - ), + ), + SizedBox( + height: 1, + ), + ], ), ); } diff --git a/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart b/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart index 780adba9..2fcab506 100644 --- a/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart +++ b/lib/pages/pharmacies/widgets/home/BestSellerWidget.dart @@ -29,7 +29,7 @@ class BestSellerWidget extends StatelessWidget { )), if (model.state != ViewState.BusyLocal) Container( - height: MediaQuery.of(context).size.height / 3 + 20, + height: MediaQuery.of(context).size.height / 3 + 1, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem( model.bestSellerProduct[i], diff --git a/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart b/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart index de34863d..a1ce0bc4 100644 --- a/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart +++ b/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart @@ -31,7 +31,12 @@ class MostViewedWidget extends StatelessWidget { )), if (model.state != ViewState.BusyLocal) Container( - height: MediaQuery.of(context).size.height / 3 + 20, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade300, width: 0.1), + borderRadius: BorderRadius.circular(8), + ), + height: MediaQuery.of(context).size.height / 3 + 1, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem( model.mostViewedProducts[i], diff --git a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart index 3c2cb710..f03c384d 100644 --- a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart +++ b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart @@ -31,7 +31,7 @@ class RecentlyViewedWidget extends StatelessWidget { if (model.state != ViewState.BusyLocal) Container( height: model.lastVisitedProducts.length > 0 - ? MediaQuery.of(context).size.height / 3 + 20 + ? MediaQuery.of(context).size.height / 3 + 1 : 0, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem( diff --git a/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart b/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart index 1289e733..9d56deff 100644 --- a/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart +++ b/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart @@ -18,8 +18,9 @@ class ViewAllHomeWidget extends StatelessWidget { children: [ Texts( title, + color: Color(0xff2E303A), bold: true, - fontSize: 16, + fontSize: 19, ), InkWell( onTap: () { From 1984400239e9ff02309dd6006f17dd4c7d1e59be Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Nov 2021 11:15:05 +0200 Subject: [PATCH 05/11] fix ontap on prodcut card --- .../pharmacies/widgets/ProductTileItem.dart | 421 +++++++++--------- 1 file changed, 213 insertions(+), 208 deletions(-) diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index f16aca03..248901b6 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -77,226 +77,230 @@ class ProductTileItem extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); - return Container( - margin: EdgeInsets.all(7), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade300, width: 0.2), - borderRadius: BorderRadius.circular(10), - color: Colors.white, - boxShadow: [ - BoxShadow( - color: Color(0xffF1F1F1), - spreadRadius: 4, - blurRadius: 5.5, - offset: Offset(0, 3), // changes position of shadow - ), - ], - ), - padding: EdgeInsets.symmetric(horizontal: 4), - width: MediaQuery.of(context).size.width / 2.8, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Stack( - // children: [ - // Container( - // margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - // alignment: Alignment.center, - // child: (item.images != null && item.images.length > 0) - // ? Image.network( - // item.images[0].src, - // fit: BoxFit.cover, - // height: itemHeight / 2, - // ) - // : Image.asset( - // "assets/images/no_image.png", - // fit: BoxFit.cover, - // height: itemHeight / 2, - // ), - // ), - // ], - // ), + return InkWell( + onTap: () => productOnClick(context), + child: Container( + margin: EdgeInsets.all(7), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey.shade300, width: 0.2), + borderRadius: BorderRadius.circular(10), + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Color(0xffF1F1F1), + spreadRadius: 4, + blurRadius: 5.5, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + padding: EdgeInsets.symmetric(horizontal: 4), + width: MediaQuery.of(context).size.width / 2.8, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Stack( + // children: [ + // Container( + // margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + // alignment: Alignment.center, + // child: (item.images != null && item.images.length > 0) + // ? Image.network( + // item.images[0].src, + // fit: BoxFit.cover, + // height: itemHeight / 2, + // ) + // : Image.asset( + // "assets/images/no_image.png", + // fit: BoxFit.cover, + // height: itemHeight / 2, + // ), + // ), + // ], + // ), - Container( - width: double.infinity, - height: MediaQuery.of(context).size.width * 0.3, - padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), - color: Colors.white, - child: Container( + Container( width: double.infinity, - height: double.infinity, - clipBehavior: Clip.antiAlias, - decoration: containerRadiusWithGradientServices(0, - lightColor: Colors.transparent, - darkColor: Colors.transparent), - child: Stack( - children: [ - Container( - width: double.infinity, - height: double.infinity, - //clipBehavior: Clip.antiAlias, - // decoration: projectProvider.isArabic - // ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) - // : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), - child: Stack( - children: [ - Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade300, width: 1.1), - borderRadius: BorderRadius.only( - topRight: Radius.circular( - item.rxMessage != null && - projectProvider.isArabic - ? 20 - : 8), - bottomLeft: Radius.circular(8), - bottomRight: Radius.circular(8), - topLeft: Radius.circular(item.rxMessage != null && - !projectProvider.isArabic - ? 25 - : 8), + height: MediaQuery.of(context).size.width * 0.3, + padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), + color: Colors.white, + child: Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: containerRadiusWithGradientServices(0, + lightColor: Colors.transparent, + darkColor: Colors.transparent), + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + //clipBehavior: Clip.antiAlias, + // decoration: projectProvider.isArabic + // ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) + // : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade300, width: 1.1), + borderRadius: BorderRadius.only( + topRight: Radius.circular( + item.rxMessage != null && + projectProvider.isArabic + ? 20 + : 8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + topLeft: Radius.circular( + item.rxMessage != null && + !projectProvider.isArabic + ? 25 + : 8), + ), ), + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + alignment: Alignment.center, + child: + (item.images != null && item.images.length > 0) + ? Padding( + padding: EdgeInsets.all(12.0), + child: Image.network( + item.images[0].src, + fit: BoxFit.cover, + height: itemHeight / 2, + ), + ) + : Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: itemHeight / 2, + ), ), - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - alignment: Alignment.center, - child: (item.images != null && item.images.length > 0) - ? Padding( - padding: EdgeInsets.all(12.0), - child: Image.network( - item.images[0].src, - fit: BoxFit.cover, - height: itemHeight / 2, + ], + ), + ), + if (item.rxMessage != null) + projectProvider.isArabic + ? Positioned( + right: -16, + top: 2, + child: Transform.rotate( + angle: math.pi / 4, + child: Container( + padding: EdgeInsets.only( + left: 18, right: 18, top: 6, bottom: 3), + color: CustomColors.accentColor, + child: Padding( + padding: EdgeInsets.all(2.0), + child: Text( + "الوصفة\n مطلوبة", + style: TextStyle( + color: Colors.white, + fontSize: 7.5, + height: 0.8, + fontWeight: FontWeight.bold, + letterSpacing: -0.27, + ), + ), ), - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: itemHeight / 2, ), - ), - ], - ), - ), - if (item.rxMessage != null) - projectProvider.isArabic - ? Positioned( - right: -16, - top: 2, - child: Transform.rotate( - angle: math.pi / 4, - child: Container( - padding: EdgeInsets.only( - left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, - child: Padding( - padding: EdgeInsets.all(2.0), + ), + ) + : Positioned( + left: -24, + top: 2, + child: Transform.rotate( + angle: -math.pi / 4, + child: Container( + padding: EdgeInsets.only( + left: 18, right: 18, top: 6, bottom: 3), + color: CustomColors.accentColor, child: Text( - "الوصفة\n مطلوبة", + "\n E-Prescription \n Is required", style: TextStyle( color: Colors.white, fontSize: 7.5, - height: 0.8, - fontWeight: FontWeight.bold, - letterSpacing: -0.27, + //letterSpacing: -0.27, + height: 1.2, + fontWeight: FontWeight.w600, ), ), ), ), ), - ) - : Positioned( - left: -24, - top: 2, - child: Transform.rotate( - angle: -math.pi / 4, - child: Container( - padding: EdgeInsets.only( - left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, - child: Text( - "\n E-Prescription \n Is required", - style: TextStyle( - color: Colors.white, - fontSize: 7.5, - //letterSpacing: -0.27, - height: 1.2, - fontWeight: FontWeight.w600, - ), - ), - ), - ), - ), - ], + ], + ), ), ), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Container( - height: MediaQuery.of(context).size.height * 0.075, - child: Texts( - projectProvider.isArabic ? item.namen : item.name, - //regular: true, - fontSize: 10, - color: Color(0xff2B353E), - fontWeight: FontWeight.w500, + Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.075, + child: Texts( + projectProvider.isArabic ? item.namen : item.name, + //regular: true, + fontSize: 10, + color: Color(0xff2B353E), + fontWeight: FontWeight.w500, + ), ), ), - ), - SizedBox( - height: 7.0, - ), - Expanded( - child: Container( - margin: EdgeInsets.symmetric( - horizontal: 4, - vertical: 0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: - const EdgeInsets.symmetric(horizontal: 10, vertical: 2), - child: Texts( - "SAR ${item.price}", - fontWeight: FontWeight.bold, - fontSize: 11, - color: Color(0xff2B353E), + SizedBox( + height: 7.0, + ), + Expanded( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: 4, + vertical: 0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 2), + child: Texts( + "SAR ${item.price}", + fontWeight: FontWeight.bold, + fontSize: 11, + color: Color(0xff2B353E), + ), ), - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 5), - child: Row( - children: [ - // Expanded( - RatingBar.readOnly( - initialRating: item.approvedRatingSum.toDouble(), - size: 15.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - Texts( - "(${item.approvedTotalReviews})", - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 5), + child: Row( + children: [ + // Expanded( + RatingBar.readOnly( + initialRating: item.approvedRatingSum.toDouble(), + size: 15.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + Texts( + "(${item.approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ), - SizedBox( - width: 10.0, - ), - Icon( - Icons.arrow_forward, - size: 15, - color: Color(0xff2D2F39), - ), + SizedBox( + width: 10.0, + ), + Icon( + Icons.arrow_forward, + size: 15, + color: Color(0xff2D2F39), + ), // StarRating( // totalAverage: item.approvedTotalReviews > 0 @@ -305,18 +309,19 @@ class ProductTileItem extends StatelessWidget { // .toDouble() // : 0, // forceStars: true), - // ), - ], + // ), + ], + ), ), - ), - ], + ], + ), ), ), - ), - SizedBox( - height: 1, - ), - ], + SizedBox( + height: 1, + ), + ], + ), ), ); } From 8f044a635a18b3a10d2bcf097b23c01e02a1a003 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 28 Nov 2021 14:31:28 +0200 Subject: [PATCH 06/11] fix footer design --- .../product-details/footor/footer-widget.dart | 58 +++++++++++++------ lib/widgets/buttons/secondary_button.dart | 10 ++-- 2 files changed, 47 insertions(+), 21 deletions(-) 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 e0cf8168..3807714e 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -57,7 +57,15 @@ class _FooterWidgetState extends State { borderRadius: BorderRadius.all( Radius.circular(0.0), ), - border: Border.all(color: Color(0xFF707070), width: 0), + boxShadow: [ + BoxShadow( + color: Color(0xFFCCCCCC), + spreadRadius: 0, + blurRadius: 4, + offset: Offset(2, 2), // changes position of shadow + ), + ], + // border: Border.all(color: Color(0xFF707070), width: 0), ), width: double.infinity, height: quantityUI, @@ -219,12 +227,12 @@ class _FooterWidgetState extends State { ), Container( width: MediaQuery.of(context).size.width * 0.35, + margin: EdgeInsets.symmetric( vertical: 5.0), + child: SecondaryButton( label: TranslationBase.of(context).addToCart, - disabled: (!widget.isAvailable && widget.quantity > 0) || - widget.quantity > widget.quantityLimit || - widget.item.isRx, - fontSize: 16, + disabled: isAddToCartDisable(), + fontSize: 15, onTap: () async { if (!authenticatedUserObject.isLogin) { login(); @@ -235,8 +243,9 @@ class _FooterWidgetState extends State { model: widget.model); }, fontWeight: FontWeight.w600, - borderColor: Color(0xFF4CAF50).withOpacity(0.7), borderRadius: 6, + disableColor:Color(0xFFD6D6D6), + textColor: isAddToCartDisable()?Color(0xFFACACAC):Colors.white, color: Color(0xFF535353), ), ), @@ -245,12 +254,13 @@ class _FooterWidgetState extends State { ), Container( width: MediaQuery.of(context).size.width * 0.35, + margin: EdgeInsets.symmetric( vertical: 5.0), + child: SecondaryButton( label: TranslationBase.of(context).buyNow, - fontSize: 16, - disabled: (!widget.isAvailable && widget.quantity > 0) || - (widget.quantity > widget.quantityLimit) || - widget.item.isRx, + fontSize: 15, + disabled: isBuyNowDisable(), + onTap: () async { if (!authenticatedUserObject.isLogin) { login(); @@ -261,15 +271,11 @@ class _FooterWidgetState extends State { model: widget.model); } }, + textColor: isBuyNowDisable()?Color(0xFFACACAC):Colors.white, fontWeight: FontWeight.w600, - borderColor: Colors.grey[800].withOpacity(0.7), borderRadius: 6, - disableColor: Colors.grey[700], - color: !widget.isAvailable && widget.quantity > 0 || - widget.quantity > widget.quantityLimit || - widget.item.isRx - ? Color(0xFF535353).withOpacity(0.7) - : Color(0xFF5AB145), + disableColor: Color(0xFFD6D6D6), + color: Color(0xFF5AB145), ), ), ], @@ -280,6 +286,24 @@ class _FooterWidgetState extends State { ); } + bool isBuyNowDisable(){ + // return true; + return (!widget.isAvailable && widget.quantity > 0) || + (widget.quantity > widget.quantityLimit) || + widget.item.isRx; + + + } + + bool isAddToCartDisable(){ + // return true; + return (!widget.isAvailable && widget.quantity > 0) || + widget.quantity > widget.quantityLimit || + widget.item.isRx; + + + } + void setUserValues(value) async { if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); } diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index 8f0ae5f1..a5ac63aa 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -200,9 +200,9 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2, decoration: BoxDecoration( - shape: BoxShape.circle, + // shape: BoxShape.circle, color: widget.disabled - ? Colors.grey + ? widget.disableColor ?? Colors.grey : widget.color ?? Theme.of(context).buttonColor, ), ), @@ -212,8 +212,8 @@ class _SecondaryButtonState extends State padding: widget.iconOnly ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) : EdgeInsets.only( - top: widget.small ? 8.0 : 14.0, - bottom: widget.small ? 6.0 : 14.0, + top: widget.small ? 8.0 : 12.0, + bottom: widget.small ? 6.0 : 12.0, left: 18.0, right: 18.0), child: Stack( @@ -246,8 +246,10 @@ class _SecondaryButtonState extends State bottom: widget.small ? 4.0 : 3.0), child: Text( widget.label, + textAlign: TextAlign.center, style: TextStyle( color: widget.textColor, + fontSize: widget.small ? 12.0 : widget.fontSize??14.0, fontWeight: FontWeight.w700, fontFamily: projectViewModel.isArabic From 01433963bd260fef240f2e3433533f61c9e418cb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Nov 2021 11:50:25 +0200 Subject: [PATCH 07/11] pharmacy home design --- .../pharmacies/widgets/ProductTileItem.dart | 14 ++-- .../widgets/home/MostViewedWidget.dart | 5 -- .../widgets/home/RecentlyViewedWidget.dart | 78 +++++++++---------- .../widgets/home/ViewAllHomeWidget.dart | 2 +- 4 files changed, 45 insertions(+), 54 deletions(-) diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index 248901b6..b349d675 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -85,6 +85,7 @@ class ProductTileItem extends StatelessWidget { border: Border.all(color: Colors.grey.shade300, width: 0.2), borderRadius: BorderRadius.circular(10), color: Colors.white, + shape: BoxShape.rectangle, boxShadow: [ BoxShadow( color: Color(0xffF1F1F1), @@ -145,7 +146,7 @@ class ProductTileItem extends StatelessWidget { Container( decoration: BoxDecoration( border: Border.all( - color: Colors.grey.shade300, width: 1.1), + color: Color(0xffF0F0F0), width: 1.0), borderRadius: BorderRadius.only( topRight: Radius.circular( item.rxMessage != null && @@ -157,7 +158,7 @@ class ProductTileItem extends StatelessWidget { topLeft: Radius.circular( item.rxMessage != null && !projectProvider.isArabic - ? 25 + ? 9 : 8), ), ), @@ -192,14 +193,13 @@ class ProductTileItem extends StatelessWidget { child: Container( padding: EdgeInsets.only( left: 18, right: 18, top: 6, bottom: 3), - color: CustomColors.accentColor, child: Padding( padding: EdgeInsets.all(2.0), child: Text( "الوصفة\n مطلوبة", style: TextStyle( color: Colors.white, - fontSize: 7.5, + fontSize: 7.0, height: 0.8, fontWeight: FontWeight.bold, letterSpacing: -0.27, @@ -222,7 +222,7 @@ class ProductTileItem extends StatelessWidget { "\n E-Prescription \n Is required", style: TextStyle( color: Colors.white, - fontSize: 7.5, + fontSize: 7.0, //letterSpacing: -0.27, height: 1.2, fontWeight: FontWeight.w600, @@ -244,7 +244,7 @@ class ProductTileItem extends StatelessWidget { //regular: true, fontSize: 10, color: Color(0xff2B353E), - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, ), ), ), @@ -266,7 +266,7 @@ class ProductTileItem extends StatelessWidget { horizontal: 10, vertical: 2), child: Texts( "SAR ${item.price}", - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w700, fontSize: 11, color: Color(0xff2B353E), ), diff --git a/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart b/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart index a1ce0bc4..01fea98e 100644 --- a/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart +++ b/lib/pages/pharmacies/widgets/home/MostViewedWidget.dart @@ -31,11 +31,6 @@ class MostViewedWidget extends StatelessWidget { )), if (model.state != ViewState.BusyLocal) Container( - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey.shade300, width: 0.1), - borderRadius: BorderRadius.circular(8), - ), height: MediaQuery.of(context).size.height / 3 + 1, child: ListView.builder( itemBuilder: (ctx, i) => ProductTileItem( diff --git a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart index f03c384d..e1eab06c 100644 --- a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart +++ b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart @@ -16,48 +16,44 @@ class RecentlyViewedWidget extends StatelessWidget { onModelReady: (model) => model.getLastVisitedProducts(), allowAny: true, builder: (_, model, wi) => NetworkBaseView( - isLocalLoader: true, - baseViewModel: model, - child: model.lastVisitedProducts.isNotEmpty - ? Container( - child: Column( - children: [ - ViewAllHomeWidget( - TranslationBase.of(context).recentlyViewed, - FinalProductsPage( - id: "", - productType: 3, - )), - if (model.state != ViewState.BusyLocal) - Container( - height: model.lastVisitedProducts.length > 0 - ? MediaQuery.of(context).size.height / 3 + 1 - : 0, - child: ListView.builder( - itemBuilder: (ctx, i) => ProductTileItem( - model.lastVisitedProducts[i], - MediaQuery.of(context).size.height / 4 + - 20), - scrollDirection: Axis.horizontal, - itemCount: model.lastVisitedProducts.length, - ), - ) - else - Container( - height: 80, - child: Center( - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[500], - ), - ), - ), - ), - ], + isLocalLoader: true, + baseViewModel: model, + child: Container( + child: Column( + children: [ + ViewAllHomeWidget( + TranslationBase.of(context).recentlyViewed, + FinalProductsPage( + id: "", + productType: 3, + )), + if (model.state != ViewState.BusyLocal) + Container( + height: model.lastVisitedProducts.length > 0 + ? MediaQuery.of(context).size.height / 3 + 1 + : 0, + child: ListView.builder( + itemBuilder: (ctx, i) => ProductTileItem( + model.lastVisitedProducts[i], + MediaQuery.of(context).size.height / 4 + 20), + scrollDirection: Axis.horizontal, + itemCount: model.lastVisitedProducts.length, ), ) - : Container(), - )); + else + Container( + height: 80, + child: Center( + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[500], + ), + ), + ), + ), + ], + ), + ))); } } diff --git a/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart b/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart index 9d56deff..2b73a15a 100644 --- a/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart +++ b/lib/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart @@ -19,7 +19,7 @@ class ViewAllHomeWidget extends StatelessWidget { Texts( title, color: Color(0xff2E303A), - bold: true, + fontWeight: FontWeight.w700, fontSize: 19, ), InkWell( From f623828d7835d43d748f79aef7121bb6ff81b9ab Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 29 Nov 2021 12:06:41 +0200 Subject: [PATCH 08/11] fix arabic language --- .../product-details/footor/footer-widget.dart | 2 - lib/pages/search_products_page.dart | 127 ++++++++++++------ 2 files changed, 89 insertions(+), 40 deletions(-) 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 3807714e..5d974cc4 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -287,7 +287,6 @@ class _FooterWidgetState extends State { } bool isBuyNowDisable(){ - // return true; return (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx; @@ -296,7 +295,6 @@ class _FooterWidgetState extends State { } bool isAddToCartDisable(){ - // return true; return (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx; diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart index 8ec9f014..74e4ff37 100644 --- a/lib/pages/search_products_page.dart +++ b/lib/pages/search_products_page.dart @@ -11,12 +11,16 @@ import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; import 'base/base_view.dart'; +import 'package:intl/intl.dart' as international; + + class SearchProductsPage extends StatefulWidget { @override @@ -27,6 +31,8 @@ class _SearchProductsPageState extends State { final textController = TextEditingController(); final _formKey = GlobalKey(); String msg = ''; + String validText=""; + bool isTextValid = true; @override Widget build(BuildContext context) { @@ -55,47 +61,90 @@ class _SearchProductsPageState extends State { width: MediaQuery.of(context).size.width * 0.70, child: Form( key: _formKey, - child: TextFields( - autoFocus: true, - hintText: TranslationBase.of(context).search, - fontSize: 14.5, - prefixIcon: Icon(Icons.search), - inputAction: TextInputAction.search, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(r'([A-Za-z0-9 a space])')) - ], - validator: (value) { - RegExp regExp = RegExp(r'([A-Za-z0-9 a space])'); - if (value.isEmpty) { - TranslationBase.of(context) - .pleaseEnterProductName; - } else if (!regExp.hasMatch(value)) { - AppToast.showErrorToast( - message: TranslationBase.of(context) - .noArabicLetters); - } - return null; - }, - onSaved: (value) { - //searchMedicine(model, context); - }, - onSubmit: (value) { - searchMedicine(model, context); + child: Column( + children: [ + TextFields( + autoFocus: true, + hintText: TranslationBase.of(context).search, + fontSize: 14.5, + prefixIcon: Icon(Icons.search), + inputAction: TextInputAction.search, + + validator: (value) { + RegExp regExp = RegExp(r'([A-Za-z0-9 a space])'); + if (value.isEmpty) { + TranslationBase.of(context) + .pleaseEnterProductName; + } else if (isRTL(value))) { + AppToast.showErrorToast( + message: TranslationBase.of(context) + .noArabicLetters); + } + return null; + }, + onChanged: (value){ + if (value.isEmpty) { + TranslationBase.of(context) + .pleaseEnterProductName; + + Future.delayed(const Duration(milliseconds: 10), (){ + setState(() { + textController.text = ""; + isTextValid = true; + }); + }) + ; + + + } else if (isRTL(value)) { + Future.delayed(const Duration(milliseconds: 10), (){ + setState(() { + textController.text = validText; + isTextValid = false; + }); + }) + ; + + }else{ + + Future.delayed(const Duration(milliseconds: 10), (){ + setState(() { + textController.text = value; + validText = value; + isTextValid = true; + }); + }) + ; + + } + + }, + onSaved: (value) { + setState(() { + textController.text = validText; + isTextValid = false; + }); + //searchMedicine(model, context); + }, + onSubmit: (value) { + searchMedicine(model, context); // msg = 'No Result Found'; - msg = TranslationBase.of(context).noResultFound; - }, - controller: textController, -// validator: (value) { -// if (value.isEmpty) { -//// return 'please Enter Product Name'; -// return TranslationBase.of(context).pleaseEnterProductName; -// } -// return null; -// }, + msg = TranslationBase.of(context).noResultFound; + }, + controller: textController, + ), + SizedBox( + width: 10.0, + ), + if(!isTextValid) + AppText( TranslationBase.of(context) + .noArabicLetters, color: Colors.red,), + ], ), ), ), + + SizedBox( width: 10.0, ), @@ -337,7 +386,9 @@ class _SearchProductsPageState extends State { ), ); } - + bool isRTL(String text) { + return international.Bidi.detectRtlDirectionality(text); + } searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) { Utils.hideKeyboard(context); if (_formKey.currentState.validate()) From 3e667d6b8745a2262bb48288e8ab331322ed3b62 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 29 Nov 2021 12:07:08 +0200 Subject: [PATCH 09/11] fix arabic language --- lib/pages/search_products_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart index 74e4ff37..f74d38d6 100644 --- a/lib/pages/search_products_page.dart +++ b/lib/pages/search_products_page.dart @@ -75,7 +75,7 @@ class _SearchProductsPageState extends State { if (value.isEmpty) { TranslationBase.of(context) .pleaseEnterProductName; - } else if (isRTL(value))) { + } else if (isRTL(value)) { AppToast.showErrorToast( message: TranslationBase.of(context) .noArabicLetters); From 16c1064a4585fe95e40ba3dbae885cca9f94a9a1 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 29 Nov 2021 15:15:44 +0200 Subject: [PATCH 10/11] PMAU-19 --- lib/config/config.dart | 4 +- .../pharmacies/widgets/home/BannerPager.dart | 28 +++++++++++- lib/widgets/others/entity_checkbox_list.dart | 43 ++++++++++++------- 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index dafe7ab9..42861cce 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/pages/pharmacies/widgets/home/BannerPager.dart b/lib/pages/pharmacies/widgets/home/BannerPager.dart index 6302f263..8c62f458 100644 --- a/lib/pages/pharmacies/widgets/home/BannerPager.dart +++ b/lib/pages/pharmacies/widgets/home/BannerPager.dart @@ -4,6 +4,9 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-registration-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -50,7 +53,7 @@ class _BannerPagerState extends State { (item, index) { return InkWell( onTap: () { - Navigator.push(context, FadePage(page: OffersCategorisePage())); + bannerNavigator(index); }, child: Container( margin: EdgeInsets.symmetric(horizontal: 1.0), @@ -93,4 +96,27 @@ class _BannerPagerState extends State { ], )); } + + bannerNavigator(index){ + switch(index) { + case 1: { + Navigator.push(context, FadePage(page: OffersCategorisePage())); + } + break; + case 2: { + Navigator.push(context, FadePage(page: LakumActivationVidaPage())); + } + break; + case 5: { + Navigator.push(context, FadePage(page: OffersCategorisePage())); + } + break; + + default: { + + } + break; + } + + } } diff --git a/lib/widgets/others/entity_checkbox_list.dart b/lib/widgets/others/entity_checkbox_list.dart index c03fe029..0a34778f 100644 --- a/lib/widgets/others/entity_checkbox_list.dart +++ b/lib/widgets/others/entity_checkbox_list.dart @@ -93,24 +93,22 @@ class _ProcedureListWidgetState extends State { historyInfo), activeColor: Colors.red[800], onChanged: (bool newValue) { - setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget - .removeHistory(historyInfo); - } else { - widget.addHistory(historyInfo); - } - }); + selectOption(historyInfo); + }), Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts(historyInfo.name, - variant: "bodyText", - bold: true, - color: Colors.black), + child: InkWell( + onTap:(){ + selectOption(historyInfo); + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts(historyInfo.name, + variant: "bodyText", + bold: true, + color: Colors.black), + ), ), ), ], @@ -142,6 +140,19 @@ class _ProcedureListWidgetState extends State { ); } + + selectOption(historyInfo){ + setState(() { + if (widget.isEntityListSelected( + historyInfo)) { + widget + .removeHistory(historyInfo); + } else { + widget.addHistory(historyInfo); + } + }); + } + void filterSearchResults(String query) { List dummySearchList = List(); dummySearchList.addAll(widget.masterList); From 6b1c0e04d0dd69458fdd798841f4f37946108893 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Nov 2021 17:10:13 +0200 Subject: [PATCH 11/11] pharmacy design home page --- .../pharmacies/widgets/ProductTileItem.dart | 96 +++++++------ .../widgets/home/RecentlyViewedWidget.dart | 78 ++++++----- lib/uitl/utils_new.dart | 128 +++++++++++++----- 3 files changed, 179 insertions(+), 123 deletions(-) diff --git a/lib/pages/pharmacies/widgets/ProductTileItem.dart b/lib/pages/pharmacies/widgets/ProductTileItem.dart index b349d675..a4988695 100644 --- a/lib/pages/pharmacies/widgets/ProductTileItem.dart +++ b/lib/pages/pharmacies/widgets/ProductTileItem.dart @@ -123,65 +123,62 @@ class ProductTileItem extends StatelessWidget { Container( width: double.infinity, height: MediaQuery.of(context).size.width * 0.3, - padding: EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 7), + padding: + EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 3.5), color: Colors.white, child: Container( width: double.infinity, height: double.infinity, clipBehavior: Clip.antiAlias, - decoration: containerRadiusWithGradientServices(0, + decoration: containerRadiusWithGradientServices(0.0, + prescriptionRequired: item.rxMessage != null, + isProduct: true, + isEnglish: !projectProvider.isArabic, lightColor: Colors.transparent, darkColor: Colors.transparent), child: Stack( children: [ - Container( - width: double.infinity, - height: double.infinity, - //clipBehavior: Clip.antiAlias, - // decoration: projectProvider.isArabic - // ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent) - // : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green), - child: Stack( - children: [ - Container( - decoration: BoxDecoration( - border: Border.all( - color: Color(0xffF0F0F0), width: 1.0), - borderRadius: BorderRadius.only( - topRight: Radius.circular( - item.rxMessage != null && - projectProvider.isArabic - ? 20 - : 8), - bottomLeft: Radius.circular(8), - bottomRight: Radius.circular(8), - topLeft: Radius.circular( - item.rxMessage != null && - !projectProvider.isArabic - ? 9 - : 8), - ), + Stack( + children: [ + Container( + decoration: BoxDecoration( + border: Border.all( + color: Color(0xffF0F0F0), width: 1.0), + borderRadius: BorderRadius.only( + topRight: Radius.circular( + item.rxMessage != null && + projectProvider.isArabic + ? 20 + : 8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + topLeft: Radius.circular(item.rxMessage != null && + !projectProvider.isArabic + ? 20 + : 8), ), - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - alignment: Alignment.center, - child: - (item.images != null && item.images.length > 0) - ? Padding( - padding: EdgeInsets.all(12.0), - child: Image.network( - item.images[0].src, - fit: BoxFit.cover, - height: itemHeight / 2, - ), - ) - : Image.asset( - "assets/images/no_image.png", - fit: BoxFit.cover, - height: itemHeight / 2, - ), ), - ], - ), + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + alignment: Alignment.center, + child: (item.images != null && item.images.length > 0) + ? Padding( + padding: EdgeInsets.all(12.0), + child: Image.network( + item.images[0].src, + fit: BoxFit.cover, + height: itemHeight / 2, + ), + ) + : Padding( + padding: EdgeInsets.all(8.0), + child: Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: itemHeight / 2, + ), + ), + ), + ], ), if (item.rxMessage != null) projectProvider.isArabic @@ -191,6 +188,7 @@ class ProductTileItem extends StatelessWidget { child: Transform.rotate( angle: math.pi / 4, child: Container( + color: CustomColors.accentColor, padding: EdgeInsets.only( left: 18, right: 18, top: 6, bottom: 3), child: Padding( @@ -201,7 +199,7 @@ class ProductTileItem extends StatelessWidget { color: Colors.white, fontSize: 7.0, height: 0.8, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w600, letterSpacing: -0.27, ), ), diff --git a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart index e1eab06c..f03c384d 100644 --- a/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart +++ b/lib/pages/pharmacies/widgets/home/RecentlyViewedWidget.dart @@ -16,44 +16,48 @@ class RecentlyViewedWidget extends StatelessWidget { onModelReady: (model) => model.getLastVisitedProducts(), allowAny: true, builder: (_, model, wi) => NetworkBaseView( - isLocalLoader: true, - baseViewModel: model, - child: Container( - child: Column( - children: [ - ViewAllHomeWidget( - TranslationBase.of(context).recentlyViewed, - FinalProductsPage( - id: "", - productType: 3, - )), - if (model.state != ViewState.BusyLocal) - Container( - height: model.lastVisitedProducts.length > 0 - ? MediaQuery.of(context).size.height / 3 + 1 - : 0, - child: ListView.builder( - itemBuilder: (ctx, i) => ProductTileItem( - model.lastVisitedProducts[i], - MediaQuery.of(context).size.height / 4 + 20), - scrollDirection: Axis.horizontal, - itemCount: model.lastVisitedProducts.length, + isLocalLoader: true, + baseViewModel: model, + child: model.lastVisitedProducts.isNotEmpty + ? Container( + child: Column( + children: [ + ViewAllHomeWidget( + TranslationBase.of(context).recentlyViewed, + FinalProductsPage( + id: "", + productType: 3, + )), + if (model.state != ViewState.BusyLocal) + Container( + height: model.lastVisitedProducts.length > 0 + ? MediaQuery.of(context).size.height / 3 + 1 + : 0, + child: ListView.builder( + itemBuilder: (ctx, i) => ProductTileItem( + model.lastVisitedProducts[i], + MediaQuery.of(context).size.height / 4 + + 20), + scrollDirection: Axis.horizontal, + itemCount: model.lastVisitedProducts.length, + ), + ) + else + Container( + height: 80, + child: Center( + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[500], + ), + ), + ), + ), + ], ), ) - else - Container( - height: 80, - child: Center( - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( - Colors.grey[500], - ), - ), - ), - ), - ], - ), - ))); + : Container(), + )); } } diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 832a92b1..ec71ff24 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -32,11 +32,16 @@ Widget getPaymentMethods() { mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Image.asset("assets/images/new/payment/Mada.png", width: 50, height: 50), - Image.asset("assets/images/new/payment/visa.png", width: 50, height: 50), - Image.asset("assets/images/new/payment/Mastercard.png", width: 50, height: 50), - Image.asset("assets/images/new/payment/Apple_Pay.png", width: 50, height: 50), - Image.asset("assets/images/new/payment/installments.png", width: 50, height: 50), + Image.asset("assets/images/new/payment/Mada.png", + width: 50, height: 50), + Image.asset("assets/images/new/payment/visa.png", + width: 50, height: 50), + Image.asset("assets/images/new/payment/Mastercard.png", + width: 50, height: 50), + Image.asset("assets/images/new/payment/Apple_Pay.png", + width: 50, height: 50), + Image.asset("assets/images/new/payment/installments.png", + width: 50, height: 50), ], ), ); @@ -48,10 +53,15 @@ Widget getNoDataWidget(BuildContext context) { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0), + SvgPicture.asset('assets/images/new/not_found.svg', + width: 110.0, height: 110.0), Container( - margin: EdgeInsets.only(top: 15.0), - child: Text(TranslationBase.of(context).noResultFound, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xFFBABABA)))), + margin: EdgeInsets.only(top: 15.0), + child: Text(TranslationBase.of(context).noResultFound, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Color(0xFFBABABA)))), ], ), ), @@ -79,7 +89,8 @@ spacer() { } Future navigateTo(context, page) async { - return await Navigator.push(context, MaterialPageRoute(builder: (context) => page)); + return await Navigator.push( + context, MaterialPageRoute(builder: (context) => page)); } // Future navigateToReplace(context, page) async { @@ -137,7 +148,11 @@ Widget circularAviator( child: Container( width: s, height: s, - decoration: containerColorRadiusBorderWidth(bcColor == null ? Colors.grey[200] : bcColor, 2000, brColor == null ? Colors.blueGrey[800] : brColor, borderWidth == null ? 2 : borderWidth), + decoration: containerColorRadiusBorderWidth( + bcColor == null ? Colors.grey[200] : bcColor, + 2000, + brColor == null ? Colors.blueGrey[800] : brColor, + borderWidth == null ? 2 : borderWidth), child: Icon( icon == null ? Icons.person : icon, size: s / 1.7, @@ -219,13 +234,14 @@ RoundedRectangleBorder buttonShape() { ); } -Decoration containerRadiusWithGradient(double radius,{Color color1,Color color2}) { +Decoration containerRadiusWithGradient(double radius, + {Color color1, Color color2}) { return BoxDecoration( borderRadius: BorderRadius.circular(radius), gradient: LinearGradient( colors: [ - color1?? Color(0xFFF71787E), - color2?? Color(0xFFF2B353E), + color1 ?? Color(0xFFF71787E), + color2 ?? Color(0xFFF2B353E), ], begin: Alignment.centerLeft, end: Alignment.centerRight, @@ -233,7 +249,8 @@ Decoration containerRadiusWithGradient(double radius,{Color color1,Color color2} ); } -Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColor, Color lightColor}) { +Decoration containerBottomRightRadiusWithGradient(double radius, + {Color darkColor, Color lightColor}) { return BoxDecoration( borderRadius: BorderRadius.only(bottomRight: Radius.circular(radius)), gradient: LinearGradient( @@ -247,7 +264,8 @@ Decoration containerBottomRightRadiusWithGradient(double radius, {Color darkColo ); } -Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color darkColor, Color lightColor}) { +Decoration containerBottomRightRadiusWithGradientForAr(double radius, + {Color darkColor, Color lightColor}) { return BoxDecoration( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius)), gradient: LinearGradient( @@ -261,9 +279,24 @@ Decoration containerBottomRightRadiusWithGradientForAr(double radius, {Color dar ); } -Decoration containerRadiusWithGradientServices(double radius, {Color darkColor, Color lightColor}) { +Decoration containerRadiusWithGradientServices( + double radius, { + Color darkColor, + Color lightColor, + bool isProduct = false, + bool prescriptionRequired = false, + bool isEnglish = true, +}) { return BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(radius)), + borderRadius: !isProduct || !prescriptionRequired + ? BorderRadius.all(Radius.circular(radius)) + : isEnglish + ? BorderRadius.only( + topLeft: Radius.circular(26), + ) + : BorderRadius.only( + topRight: Radius.circular(26), + ), gradient: LinearGradient( colors: [ darkColor == null ? Color(0xFF2B353E) : darkColor, @@ -275,7 +308,11 @@ Decoration containerRadiusWithGradientServices(double radius, {Color darkColor, ); } -Decoration containerBottomRightRadiusWithGradientBorder(double radius, {Color darkColor, Color lightColor, Color borderColor = Colors.transparent, double w = 0}) { +Decoration containerBottomRightRadiusWithGradientBorder(double radius, + {Color darkColor, + Color lightColor, + Color borderColor = Colors.transparent, + double w = 0}) { return BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(radius)), border: Border.all( @@ -304,7 +341,8 @@ Decoration containerRadius(Color background, double radius) { ); } -Decoration containerColorRadiusBorder(Color background, double radius, Color color) { +Decoration containerColorRadiusBorder( + Color background, double radius, Color color) { return BoxDecoration( color: background, border: Border.all( @@ -315,7 +353,8 @@ Decoration containerColorRadiusBorder(Color background, double radius, Color col ); } -Decoration containerColorRadiusBorderWidth(Color background, double radius, Color color, double w) { +Decoration containerColorRadiusBorderWidth( + Color background, double radius, Color color, double w) { return BoxDecoration( color: background, border: Border.all( @@ -326,13 +365,14 @@ Decoration containerColorRadiusBorderWidth(Color background, double radius, Colo ); } -Decoration containerColorRadiusBorderWidthCircular(Color background, double radius, Color color, double w) { +Decoration containerColorRadiusBorderWidthCircular( + Color background, double radius, Color color, double w) { return BoxDecoration( color: background, border: Border.all( width: w, // color: color // <--- border width here - ), + ), // borderRadius: BorderRadius.circular(radius), shape: BoxShape.circle, ); @@ -341,29 +381,36 @@ Decoration containerColorRadiusBorderWidthCircular(Color background, double radi Decoration containerColorRadiusRight(Color background, double radius) { return BoxDecoration( color: background, - borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), + borderRadius: BorderRadius.only( + topRight: Radius.circular(radius), + bottomRight: Radius.circular(radius)), ); } Decoration containerColorRadiusLeft(Color background, double radius) { return BoxDecoration( color: background, - borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), ); } -Decoration containerColorRadiusRightBorder(Color background, double radius, double w) { +Decoration containerColorRadiusRightBorder( + Color background, double radius, double w) { return BoxDecoration( color: background, border: Border.all( width: w, // color: Colors.white // <--- border width here ), - borderRadius: BorderRadius.only(topRight: Radius.circular(radius), bottomRight: Radius.circular(radius)), + borderRadius: BorderRadius.only( + topRight: Radius.circular(radius), + bottomRight: Radius.circular(radius)), ); } -Decoration containerColorRadiusRightBorderc(Color background, double radius, double w, Color borderColor) { +Decoration containerColorRadiusRightBorderc( + Color background, double radius, double w, Color borderColor) { return BoxDecoration( color: background, border: Border.all( @@ -394,21 +441,23 @@ Decoration containerColorRadiusBottom(Color color, double radius) { ); } -Decoration containerColorRadiusLeftBorder(Color background, double radius, double w) { +Decoration containerColorRadiusLeftBorder( + Color background, double radius, double w) { return BoxDecoration( color: background, border: Border.all( width: w, // color: Colors.white // <--- border width here ), - borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(radius), bottomLeft: Radius.circular(radius)), ); } -BoxDecoration cardRadius(double radius,{Color color,double elevation}) { - return BoxDecoration( +BoxDecoration cardRadius(double radius, {Color color, double elevation}) { + return BoxDecoration( shape: BoxShape.rectangle, - color: color??Colors.white, + color: color ?? Colors.white, borderRadius: BorderRadius.all( Radius.circular(radius), ), @@ -416,7 +465,7 @@ BoxDecoration cardRadius(double radius,{Color color,double elevation}) { BoxShadow( color: Color(0xff000000).withOpacity(.05), //spreadRadius: 5, - blurRadius:elevation?? 27, + blurRadius: elevation ?? 27, offset: Offset(-2, 3), ), ], @@ -433,19 +482,23 @@ ShapeBorder cardRadiusNew(double radius) { ShapeBorder cardRadiusTop(double radius) { return RoundedRectangleBorder( side: BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), ); } ShapeBorder cardRadiusTop2(double radius) { return RoundedRectangleBorder( - borderRadius: BorderRadius.only(topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(radius), topRight: Radius.circular(radius)), ); } ShapeBorder cardRadiusBottom(double radius) { return RoundedRectangleBorder( - borderRadius: BorderRadius.only(bottomLeft: Radius.circular(radius), bottomRight: Radius.circular(radius)), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(radius), + bottomRight: Radius.circular(radius)), ); } @@ -568,7 +621,8 @@ FontStyle getFontStyle(String fontStyle) { bool timeCalculator(int startHour, int startMint, int endHour, int endMint) { DateTime now = DateTime.now(); - DateTime startDate = DateTime(now.year, now.month, now.day, startHour, startHour); + DateTime startDate = + DateTime(now.year, now.month, now.day, startHour, startHour); DateTime endDate = DateTime(now.year, now.month, now.day, endHour, endMint); if (startDate.isBefore(now) && endDate.isAfter(now)) return true;