From de86cffb8c7e1bbf291985c80c867ac23761af8d Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 8 Dec 2021 09:45:11 +0300 Subject: [PATCH 1/4] fix lakum issues --- lib/config/localized_values.dart | 2 + .../screens/cart-page/cart-order-preview.dart | 130 +++++++++++++++++- .../screens/cart-page/lakum_widget.dart | 32 +++++ .../cart-page/payment_bottom_widget.dart | 7 + .../screens/lacum-transfer-page.dart | 7 +- .../pharmacies/screens/lakum-main-page.dart | 2 + .../product-details/footor/footer-widget.dart | 5 +- .../screens/product-details/reviews_info.dart | 58 +++++--- lib/pages/pharmacy/order/OrderDetails.dart | 2 +- lib/pages/pharmacy/pharmacyContacts.dart | 7 +- lib/uitl/translations_delegate_base.dart | 4 + 11 files changed, 229 insertions(+), 27 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7e0f8166..70f2e056 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -277,6 +277,8 @@ const Map localizedValues = { "viewAll": {"en": "View All", 'ar': 'عرض الكل'}, "view": {"en": "View", 'ar': 'عرض'}, "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, + "contactUsLocation": {"en": "P.O.Box: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", 'ar': 'صندوق بريد: 91877 - الرياض 11643 ، طريق الملك فهد - العليا - المملكة العربية السعودية'}, + "contactUsTime": {"en": "Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - 8:00 PM", 'ar': " السبت – الأربعاء 08:00 ص – 10:00 م , الخميس 08:00 ص – 08:00 م, الجمعة 02:00 م - 08:00 م"}, "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart index 0110984c..559817c1 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; @@ -17,8 +18,11 @@ class OrderPreviewPage extends StatefulWidget { final List addresses; final OrderPreviewViewModel model; + + OrderPreviewPage({this.addresses, this.model}); + @override _OrderPreviewPageState createState() => _OrderPreviewPageState(); } @@ -26,6 +30,10 @@ class OrderPreviewPage extends StatefulWidget { class _OrderPreviewPageState extends State { MyInAppBrowser browser; bool isLoading = true; + bool isChecked = false; + + + @override void initState() { @@ -40,6 +48,7 @@ class _OrderPreviewPageState extends State { }); } + @override Widget build(BuildContext context) { final mediaQuery = MediaQuery.of(context); @@ -74,7 +83,79 @@ class _OrderPreviewPageState extends State { ? Container( child: Column( children: [ - LakumWidget(widget.model), + // LakumWidget(widget.model), + Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), + child: Row( + children: [ + Row( + children: [ + SizedBox( + height: 24.0, + width: 24.0, + child: Checkbox( + activeColor: CustomColors.green, + value: isChecked, + onChanged: (bool value) { + setState(() { + isChecked = value; + print(isChecked); + if (value){ + // isChecked; + PaymentBottomWidget.isChecked = true; + print(value); + }else{ + PaymentBottomWidget.isChecked = false; + } + setState(() { + }); + }); + }, + ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + TranslationBase.of(context).useLakumPoints + + " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), + ), + ], + ), + Expanded( + child: Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "${TranslationBase.of(context).availableBalance}", + fontSize: 12, + fontWeight: FontWeight.bold, + ), + Text( + "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) + ), + ], + ), + ), + ], + ), + + ), + ), + + ], + ), + ), SizedBox( height: 10, ), @@ -190,7 +271,32 @@ class _OrderPreviewPageState extends State { indent: 0, endIndent: 0, ), + isChecked ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + "${TranslationBase.of(context).lakum}", + fontSize: 14, + color: Colors.green, + fontWeight: FontWeight.w500, + ), + Texts( + "- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", + fontSize: 14, + color: Colors.green, + fontWeight: FontWeight.w500, + ), + ], + ) : Container(), + isChecked ? const Divider( + color: Color(0xFFD6D6D6), + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ): Container(), + isChecked ? Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts( @@ -200,7 +306,24 @@ class _OrderPreviewPageState extends State { fontWeight: FontWeight.bold, ), Texts( - "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", + " ${TranslationBase.of(context).sar}""${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( + TranslationBase.of(context).total, + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Texts( + " ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", fontSize: 14, color: Colors.black, fontWeight: FontWeight.bold, @@ -228,9 +351,12 @@ class _OrderPreviewPageState extends State { child: PaymentBottomWidget(widget.model), ), ); + } changeMainState() { setState(() {}); } + + } diff --git a/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart b/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart index 5d48fe1f..77c3d587 100644 --- a/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart +++ b/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart @@ -1,5 +1,8 @@ +import 'dart:ui'; + import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-preview.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -9,6 +12,7 @@ import 'package:provider/provider.dart'; class LakumWidget extends StatefulWidget { final OrderPreviewViewModel model; + LakumWidget(this.model); @override @@ -41,6 +45,15 @@ class _LakumWidgetState extends State { setState(() { useLakumWidgets = value; print(useLakumWidgets); +// if (value){ +// // isChecked; +// OrderPreviewPage.isChecked = true; +// print(value); +// }else{ +// OrderPreviewPage.isChecked = false; +// } + setState(() { + }); }); }, ), @@ -150,6 +163,25 @@ class _LakumWidgetState extends State { // ), ), ), +// useLakumWidgets ? +// Row( +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Texts( +// "${TranslationBase.of(context).lakum}", +// fontSize: 14, +// color: Colors.black, +// fontWeight: FontWeight.w500, +// ), +// Texts( +// "${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance).toStringAsFixed(2)}", +// fontSize: 14, +// color: Colors.black, +// fontWeight: FontWeight.w500, +// ), +// ], +// ) +// :Container() ], ), ); diff --git a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart index 1931f3fa..00595711 100644 --- a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart +++ b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart @@ -16,6 +16,7 @@ import 'package:provider/provider.dart'; class PaymentBottomWidget extends StatelessWidget { final OrderPreviewViewModel model; + static bool isChecked = true; BuildContext context; MyInAppBrowser browser; @@ -42,6 +43,12 @@ class PaymentBottomWidget extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 0, vertical: 4), child: Row( children: [ + isChecked ? Texts( + "${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount - model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", + fontSize: 14, + fontWeight: FontWeight.bold, + color: Color(0xff929295), + ): Texts( "${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}", fontSize: 14, diff --git a/lib/pages/pharmacies/screens/lacum-transfer-page.dart b/lib/pages/pharmacies/screens/lacum-transfer-page.dart index b3995aca..057b444c 100644 --- a/lib/pages/pharmacies/screens/lacum-transfer-page.dart +++ b/lib/pages/pharmacies/screens/lacum-transfer-page.dart @@ -41,6 +41,9 @@ class _LacumTransferPageState extends State { isShowAppBar: true, isPharmacy: true, isShowDecPage: false, + showHomeAppBarIcon: false, + isBottomBar: true, + showPharmacyCart: false, backgroundColor: Colors.white, baseViewModel: model, body: Container( @@ -105,7 +108,7 @@ class _LacumTransferPageState extends State { CrossAxisAlignment.end, children: [ Texts( - "0", + "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}", fontSize: 14, fontWeight: FontWeight.bold, color: Colors.white, @@ -165,7 +168,7 @@ class _LacumTransferPageState extends State { CrossAxisAlignment.end, children: [ Texts( - "0", + "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}", fontSize: 14, fontWeight: FontWeight.bold, color: Colors.white, diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart index 681be5a5..db441433 100644 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -44,6 +44,8 @@ class LakumMainPage extends StatelessWidget { isPharmacy: true, showPharmacyCart: false, isShowDecPage: false, + showHomeAppBarIcon: false, + isBottomBar: true, backgroundColor: Colors.white, baseViewModel: model, appBarIcons: _buildAppBarICons(context, model), 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 5d974cc4..44d9b2d7 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -227,7 +227,7 @@ class _FooterWidgetState extends State { ), Container( width: MediaQuery.of(context).size.width * 0.35, - margin: EdgeInsets.symmetric( vertical: 5.0), + margin: EdgeInsets.symmetric( vertical: 4.0), child: SecondaryButton( label: TranslationBase.of(context).addToCart, @@ -254,7 +254,8 @@ class _FooterWidgetState extends State { ), Container( width: MediaQuery.of(context).size.width * 0.35, - margin: EdgeInsets.symmetric( vertical: 5.0), + margin: EdgeInsets.symmetric( vertical: 4.0), + child: SecondaryButton( label: TranslationBase.of(context).buyNow, diff --git a/lib/pages/pharmacies/screens/product-details/reviews_info.dart b/lib/pages/pharmacies/screens/product-details/reviews_info.dart index c4526790..52efd3e9 100644 --- a/lib/pages/pharmacies/screens/product-details/reviews_info.dart +++ b/lib/pages/pharmacies/screens/product-details/reviews_info.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class ReviewsInfo extends StatelessWidget { @@ -13,6 +15,7 @@ class ReviewsInfo extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return previousModel.productDetailService.length != 0 && previousModel.productDetailService[0].reviews.length != 0 ? ListView.builder( @@ -48,18 +51,36 @@ class ReviewsInfo extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only(left: 210), - child: RatingBar.readOnly( - initialRating: previousModel - .productDetailService[0].reviews[index].rating - .toDouble(), - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + // margin: EdgeInsets.only(left: 210), + child: projectViewModel.isArabic? + Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: previousModel + .productDetailService[0].reviews[index].rating + .toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ): Align( + alignment: Alignment.topRight, + child: RatingBar.readOnly( + initialRating: previousModel + .productDetailService[0].reviews[index].rating + .toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), ), ), ], @@ -68,11 +89,14 @@ class ReviewsInfo extends StatelessWidget { SizedBox( height: 10, ), - Container( - child: Text( - previousModel - .productDetailService[0].reviews[index].reviewText, - style: TextStyle(fontSize: 20), + Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Text( + previousModel + .productDetailService[0].reviews[index].reviewText, + style: TextStyle(fontSize: 20), + ), ), ), SizedBox( diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 6b7c957e..6ffe7131 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -715,7 +715,7 @@ class _OrderDetailsPageState extends State { Navigator.pop(context); Navigator.pop(context); } else { - AppToast.showErrorToast(message: "Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration"); + AppToast.showErrorToast(message: "Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration\فشلت العملية حاول مره اخرى"); } } } diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart index 03a6c29d..61fbd61a 100644 --- a/lib/pages/pharmacy/pharmacyContacts.dart +++ b/lib/pages/pharmacy/pharmacyContacts.dart @@ -39,6 +39,7 @@ class _pharmacyContactsPageState extends State { showPharmacyCart: false, showHomeAppBarIcon: false, isMainPharmacyPages: true, + isBottomBar: true, body:Column( children: [ Card( @@ -64,7 +65,7 @@ class _pharmacyContactsPageState extends State { Padding( padding: const EdgeInsets.all(8.0), child: Container( - child: Text("Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - -8:00 PM", + child: Text(TranslationBase.of(context).contactUsTime, style: TextStyle( color: Colors.grey[700], fontSize: 16, @@ -179,7 +180,7 @@ class _pharmacyContactsPageState extends State { ), Expanded( child: Text( - "P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", + TranslationBase.of(context).contactUsLocation, style: TextStyle( color: Colors.grey[700], fontSize: 16, @@ -245,7 +246,7 @@ class _pharmacyContactsPageState extends State { openWhatsApp() async{ // bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS; - var whatsapp ="+699558434444"; + var whatsapp ="+966558434444"; var whatsappURL_android = "whatsapp://send?phone="+whatsapp; var whatappURL_ios ="https://wa.me/$whatsapp"; if(Platform.isIOS){ diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index cfe30e91..e69e36fb 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -591,6 +591,10 @@ class TranslationBase { String get contactUs => localizedValues['ContactUs'][locale.languageCode]; + String get contactUsLocation => localizedValues['contactUsLocation'][locale.languageCode]; + + String get contactUsTime => localizedValues['contactUsTime'][locale.languageCode]; + String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode]; String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; From cf7dd13a8330a8499cc3e3216b3065c9063bda22 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 8 Dec 2021 11:45:36 +0300 Subject: [PATCH 2/4] fix issue --- .../screens/cart-page/cart-order-preview.dart | 149 +++++++++--------- 1 file changed, 76 insertions(+), 73 deletions(-) diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart index 559817c1..89b2725c 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart @@ -80,88 +80,91 @@ class _OrderPreviewPageState extends State { height: 10, ), widget.model.paymentCheckoutData.lacumInformation != null - ? Container( - child: Column( - children: [ - // LakumWidget(widget.model), - Container( - color: Colors.white, - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Row( - children: [ - SizedBox( - height: 24.0, - width: 24.0, - child: Checkbox( - activeColor: CustomColors.green, - value: isChecked, - onChanged: (bool value) { - setState(() { - isChecked = value; - print(isChecked); - if (value){ - // isChecked; - PaymentBottomWidget.isChecked = true; - print(value); - }else{ - PaymentBottomWidget.isChecked = false; - } + ? AbsorbPointer( + absorbing: true, + child: Container( + child: Column( + children: [ + // LakumWidget(widget.model), + Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), + child: Row( + children: [ + Row( + children: [ + SizedBox( + height: 24.0, + width: 24.0, + child: Checkbox( + activeColor: CustomColors.green, + value: isChecked, + onChanged: (bool value) { setState(() { + isChecked = value; + print(isChecked); + if (value){ + // isChecked; + PaymentBottomWidget.isChecked = true; + print(value); + }else{ + PaymentBottomWidget.isChecked = false; + } + setState(() { + }); }); - }); - }, + }, + ), ), - ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text( - TranslationBase.of(context).useLakumPoints + - " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", - style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), - ), - ], - ), - Expanded( - child: Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "${TranslationBase.of(context).availableBalance}", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - Text( - "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", - style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) - ), - ], + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + TranslationBase.of(context).useLakumPoints + + " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), + ), + ], + ), + Expanded( + child: Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "${TranslationBase.of(context).availableBalance}", + fontSize: 12, + fontWeight: FontWeight.bold, + ), + Text( + "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) + ), + ], + ), ), - ), - ], - ), + ], + ), + ), ), - ), - ], + ], + ), ), - ), - SizedBox( - height: 10, - ), - ], + SizedBox( + height: 10, + ), + ], + ), ), - ) + ) : Container(), Container( color: Colors.white, From f9d1bbe2eeedec4723313c0873bae89d3eb58356 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Wed, 8 Dec 2021 14:34:09 +0300 Subject: [PATCH 3/4] disable lakum on check out page --- .../screens/cart-page/cart-order-preview.dart | 156 ++++++++++-------- 1 file changed, 83 insertions(+), 73 deletions(-) diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart index 89b2725c..dc8dc0d7 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart'; @@ -82,88 +84,96 @@ class _OrderPreviewPageState extends State { widget.model.paymentCheckoutData.lacumInformation != null ? AbsorbPointer( absorbing: true, - child: Container( - child: Column( - children: [ - // LakumWidget(widget.model), - Container( - color: Colors.white, - padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), - child: Row( - children: [ - Row( + child: Stack( + children: [ + Container( + child: Column( + children: [ + // LakumWidget(widget.model), + Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), + child: Row( children: [ - SizedBox( - height: 24.0, - width: 24.0, - child: Checkbox( - activeColor: CustomColors.green, - value: isChecked, - onChanged: (bool value) { - setState(() { - isChecked = value; - print(isChecked); - if (value){ - // isChecked; - PaymentBottomWidget.isChecked = true; - print(value); - }else{ - PaymentBottomWidget.isChecked = false; - } - setState(() { - }); - }); - }, - ), - ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text( - TranslationBase.of(context).useLakumPoints + - " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", - style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), - ), - ], - ), - Expanded( - child: Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, + Row( children: [ - Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "${TranslationBase.of(context).availableBalance}", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - Text( - "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", - style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) - ), - ], + SizedBox( + height: 24.0, + width: 24.0, + child: Checkbox( + activeColor: CustomColors.green, + value: isChecked, + onChanged: (bool value) { + setState(() { + isChecked = value; + print(isChecked); + if (value){ + // isChecked; + PaymentBottomWidget.isChecked = true; + print(value); + }else{ + PaymentBottomWidget.isChecked = false; + } + setState(() { + }); + }); + }, ), ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + TranslationBase.of(context).useLakumPoints + + " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), + ), ], ), + Expanded( + child: Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration(color: Color(0x99ffffff)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "${TranslationBase.of(context).availableBalance}", + fontSize: 12, + fontWeight: FontWeight.bold, + ), + Text( + "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) + ), + ], + ), + ), + ], + ), + + ), + ), - ), + ], ), - - ], - ), - ), - SizedBox( - height: 10, + ), + SizedBox( + height: 10, + ), + ], ), - ], - ), - ), + ), + Container( + height: MediaQuery.of(context).size.height * .10, + color: Colors.white.withOpacity(0.6), + ) + ], + ), ) : Container(), Container( From b09b1e4732b48c712e75957e7a15511d76618b34 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Thu, 9 Dec 2021 09:58:17 +0300 Subject: [PATCH 4/4] six issues --- lib/config/localized_values.dart | 3 +- lib/pages/pharmacies/search_brands_page.dart | 2 +- lib/pages/pharmacy/pharmacyContacts.dart | 32 +++++++++++++++----- lib/pages/pharmacy/profile/profile.dart | 4 +-- lib/pages/search_products_page.dart | 2 +- lib/uitl/translations_delegate_base.dart | 2 ++ 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 814ebe4b..83fedc90 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -50,7 +50,8 @@ const Map localizedValues = { 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'search': {'en': 'Search', 'ar': 'بحث'}, - 'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'}, + 'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج '}, + 'noSearchResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'}, 'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, 'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'}, diff --git a/lib/pages/pharmacies/search_brands_page.dart b/lib/pages/pharmacies/search_brands_page.dart index c452f82f..72dc3907 100644 --- a/lib/pages/pharmacies/search_brands_page.dart +++ b/lib/pages/pharmacies/search_brands_page.dart @@ -59,7 +59,7 @@ class _SearchBrandsPageState extends State { }, onSubmit: (value) { searchMedicine(model, context); - msg = TranslationBase.of(context).noResultFound; + msg = TranslationBase.of(context).noSearchResultFound; }, controller: textController, // validator: (value) { diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart index 99af50f3..a4ce3a56 100644 --- a/lib/pages/pharmacy/pharmacyContacts.dart +++ b/lib/pages/pharmacy/pharmacyContacts.dart @@ -6,6 +6,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:map_launcher/map_launcher.dart'; +import 'dart:io' show Platform; class pharmacyContactsPage extends StatefulWidget { @override @@ -21,6 +23,7 @@ class _pharmacyContactsPageState extends State { final whatsApp = "+966558434444"; final whatappURL_android = "whatsapp://send?phone=" + whatsApp; final whatappURL_ios = "https://wa.me/$whatsApp"; + final locationDescription = "Main Pharmacy OLAYA"; return AppScaffold( appBarTitle: TranslationBase.of(context).contactUs, @@ -30,6 +33,7 @@ class _pharmacyContactsPageState extends State { showPharmacyCart: false, showHomeAppBarIcon: false, isMainPharmacyPages: true, + isBottomBar: true, body: Column( children: [ Card( @@ -143,10 +147,24 @@ class _pharmacyContactsPageState extends State { children: [ InkWell( onTap: () { - MapsLauncher.launchCoordinates( - double.parse(latitude), - double.parse(longitude)); - }, + if (Platform.isIOS) { MapLauncher.showMarker( + mapType: MapType.apple, + coords: Coords(double.parse(latitude), + double.parse(longitude)), + title: locationDescription,); + } else { MapLauncher.showMarker( + mapType: MapType.google, + coords: Coords(double.parse(latitude), + double.parse(longitude)), + title: locationDescription, + // description: location.locationName, + ); } + // MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription); + }, +// MapsLauncher.launchCoordinates( +// double.parse(latitude), +// double.parse(longitude)); +// }, child: SvgPicture.asset( 'assets/images/pharmacy/location.svg', width: 20, @@ -182,7 +200,7 @@ class _pharmacyContactsPageState extends State { iconSize: 48, onPressed: () { setState(() { - launch("https://facebook.com/HMG"); + launch("https://facebook.com/HMG.pharmacy"); // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); }); }, @@ -194,7 +212,7 @@ class _pharmacyContactsPageState extends State { iconSize: 48, onPressed: () { setState(() { - launch("https://twitter.com/HMG"); + launch("https://twitter.com/HMG_pharmacy"); }); }, ), @@ -205,7 +223,7 @@ class _pharmacyContactsPageState extends State { iconSize: 48, onPressed: () { setState(() { - launch("https://instagram.com/HMG"); + launch("https://instagram.com/HMG_pharmacy"); }); }, ), diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 25c6e7d2..c92493dc 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -474,8 +474,8 @@ class _ProfilePageState extends State { SizedBox( width: 10, ), - Text( - TranslationBase.of(context).conditionsHMG, + Text( TranslationBase.of(context).termOfService, + // TranslationBase.of(context).conditionsHMG, style: TextStyle( fontSize: 13.0, ), diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart index 79b3025e..d40d490f 100644 --- a/lib/pages/search_products_page.dart +++ b/lib/pages/search_products_page.dart @@ -71,7 +71,7 @@ class _SearchProductsPageState extends State { onSubmit: (value) { searchMedicine(model, context); // msg = 'No Result Found'; - msg = TranslationBase.of(context).noResultFound; + msg = TranslationBase.of(context).noSearchResultFound; }, controller: textController, ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index e69e36fb..5fdcbb01 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -71,6 +71,8 @@ class TranslationBase { String get noResultFound => localizedValues['noResultFound'][locale.languageCode]; + String get noSearchResultFound => localizedValues['noSearchResultFound'][locale.languageCode]; + String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode]; String get bookNow => localizedValues['bookNow'][locale.languageCode];