From 9d9377d59f5cf5dfeb275d50f82e5ddbbe8fbd4e Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 30 Nov 2021 11:34:46 +0300 Subject: [PATCH 1/4] fix issues --- assets/images/pharmacy/call.svg | 7 +++++++ assets/images/pharmacy/instagram.png | Bin 0 -> 7247 bytes assets/images/pharmacy/location.svg | 3 +++ assets/images/pharmacy/whatsapp.svg | 3 +++ lib/pages/pharmacy/pharmacyContacts.dart | 0 5 files changed, 13 insertions(+) create mode 100644 assets/images/pharmacy/call.svg create mode 100644 assets/images/pharmacy/instagram.png create mode 100644 assets/images/pharmacy/location.svg create mode 100644 assets/images/pharmacy/whatsapp.svg create mode 100644 lib/pages/pharmacy/pharmacyContacts.dart diff --git a/assets/images/pharmacy/call.svg b/assets/images/pharmacy/call.svg new file mode 100644 index 00000000..677d4123 --- /dev/null +++ b/assets/images/pharmacy/call.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/pharmacy/instagram.png b/assets/images/pharmacy/instagram.png new file mode 100644 index 0000000000000000000000000000000000000000..a03f47bd3abe5e851905e98ab075f741443aa9ac GIT binary patch literal 7247 zcmX9@cT^MI(+&_YG?Cs3f`Et=k*1I$MZf|oAVuj&?;R3C1R>Hzq$$N8s7NnLhtPYI z-bn%o(nAq~3Gn4T-=1^#p1XhS%zfs$v(L=NJTcH^WfEWl006A|dfLyZGy1;)VxZnT zptb|l3FxP(Zw#VdNRY!@>YCA8&)g3HpsW0E(EN?u(WgG-_t!D=H}Z1y53==r1qccX zl5_EN^Ru`0ekJGS>-1??LjV8}9MspoXB?chlO2-9HCcbsVi<68RMOfidc9ZjEv;Cd zcDb0SkKrS`vSjTtRi7}+Jgk6U{jGZJYD4Evo=>9>B41K678{c{P5;X+@5+iVH$5*G zdj>zdqcx)N?g&{oXvAW2{PwsJMNEt{$dwPN2b0cxsTwTwe9RNBT|hg#Yq1P&lR#Hl*5@*W z2ekC_Cb6}b+U=K|hU;?`?4EJGjeDCtFE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ha^<2H;`&Q}sdo6~rsk46G}Hfb+vh$60M3>U>;f|{y4NbKI!u2(7c97w zc*8{w1wwr!PG>v+*$Udrnf<^?1Nf6XaH2U>%;#p&OznH8q1Z7|Db}_T%{ntTW{VD7bKxc+>CWGquJ<;Y5jk0`V1Hv5m1pVRG*89_vv^S%u&5yhW8_AW`NB} z-EXqGU8(UZ{wfKAQSX(!34y$jJ@Z!)HG!K7T2>KOE3 zN_sp7Eo(o3lO6B;T$uaJ1MknFHkH(17T#h4YKyJXu^(8Tkyv9(o^|v;*{I-ckn2_A z^GLb^*L?v)y}Bn}8uuQ8;bf@_Pb7o`51JA*z%2Kzt#SzQS#5TREI`BD_zGB{K;Ulw zTai~4Yy1w+i{9`7NURLAz^Sd8Dg#;bbc+ClVKu}GVEOoI2y%HPWjQfGR6$2sq0db5 zp2_hu{|_8|zv0+>nz39`1QlrxRlQ=dNru9}&bcUCOl3)F&E|8dD + + diff --git a/assets/images/pharmacy/whatsapp.svg b/assets/images/pharmacy/whatsapp.svg new file mode 100644 index 00000000..ee18370c --- /dev/null +++ b/assets/images/pharmacy/whatsapp.svg @@ -0,0 +1,3 @@ + + + diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart new file mode 100644 index 00000000..e69de29b From bc9fc5a878fe78a57bad4fc23048c0588b394cb9 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 30 Nov 2021 11:35:06 +0300 Subject: [PATCH 2/4] fix issue --- lib/config/localized_values.dart | 6 +- .../PharmacyAddressesViewModel.dart | 4 +- lib/pages/final_products_page.dart | 68 +- lib/pages/pharmacies/compare-list.dart | 2 +- lib/pages/pharmacies/compare.dart | 585 +++++++++--------- .../pharmacies/screens/lakum-main-page.dart | 12 +- .../product-name-and-price.dart | 48 +- lib/pages/pharmacies/search_brands_page.dart | 14 - lib/pages/pharmacy/order/ProductReview.dart | 2 + .../pharmacyAddresses/PharmacyAddresses.dart | 35 +- lib/pages/pharmacy/pharmacyContacts.dart | 267 ++++++++ lib/pages/pharmacy/profile/profile.dart | 3 +- lib/pages/search_products_page.dart | 16 - lib/uitl/translations_delegate_base.dart | 8 + lib/widgets/pharmacy/product_tile.dart | 2 +- 15 files changed, 713 insertions(+), 359 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index aa9c5b16..f578c465 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -50,7 +50,7 @@ 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': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'}, 'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, 'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'}, @@ -507,7 +507,11 @@ const Map localizedValues = { "reachUs": {"en": "Reach Us", "ar": "الوصول لنا"}, "ourLocations": {"en": "Our Locations", "ar": "مواقعنا"}, "edit": {"en": "Edit", "ar": "تعديل"}, + "whatsApp": {"en": "Whats App", "ar": " واتس اب"}, + "phone": {"en": "Phone", "ar": " موبايل"}, "delete": {"en": "Delete", "ar": " حذف"}, + "deleteAddress": {"en": "Are you sure want to delete", "ar": " هل انت متأكد تريد حذف هذا العنوان"}, + "deletedAddres": {"en": "Address has been deleted", "ar": " تم حذف العنوان"}, "addAddress": {"en": "ADD A NEW ADDRESS", "ar": " اضافة عنوان جديد"}, "addNewAddress": {"en": "Add New Address", "ar": " اضافة عنوان جديد"}, "order": {"en": "My Order", "ar": " طلباتي"}, diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 72342b56..dae79ac1 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -99,9 +99,9 @@ class PharmacyAddressesViewModel extends BaseViewModel { } - Future deleteAddresses(AddressInfo sendingAddress) async { + Future deleteAddresses(AddressInfo address) async { setState(ViewState.Busy); - await _pharmacyAddressService.deleteCustomerAddress(sendingAddress); + await _pharmacyAddressService.deleteCustomerAddress(address); if (_pharmacyAddressService.hasError) { error = _pharmacyAddressService.error; setState(ViewState.Error); diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart index 253d7c08..41fa74f0 100644 --- a/lib/pages/final_products_page.dart +++ b/lib/pages/final_products_page.dart @@ -216,20 +216,37 @@ class _FinalProductsPageState extends State { Container( margin: EdgeInsets.fromLTRB(0, 16, 0, 0), alignment: Alignment.center, - child: Image.network( - model.finalProducts[index].images.isNotEmpty - ? model.finalProducts[index].images[0].thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.cover, - height: 80, - ), + child: (model.finalProducts[index].images != null && + model.finalProducts[index].images.length > 0) + ? Image.network( + model.finalProducts[index].images[0].src, + fit: BoxFit.cover, + height: 80, + width: 80, + + ) + : Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: 80, + width: 80, + ), +// Image.network( +// model.finalProducts[index].images.isNotEmpty +// ? model.finalProducts[index].images[0].thumb +// : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', +// fit: BoxFit.cover, +// height: 80, +// ), ), Container( - width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0, + width: model.finalProducts[index].rxMessage != null ? double.infinity : 0, + //MediaQuery.of(context).size.width / 2.8 : 0, padding: EdgeInsets.all(4), decoration: BoxDecoration( color: Color(0xffb23838), - borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), + // borderRadius: BorderRadius.only(topLeft: Radius.circular(6) + // ), ), child: model.finalProducts[index].rxMessage != null ? Texts( @@ -374,33 +391,48 @@ class _FinalProductsPageState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + margin: EdgeInsets.fromLTRB(0, 0, 0, 8), alignment: Alignment.center, - child: Image.network( - model.finalProducts[index].images.isNotEmpty - ? model.finalProducts[index].images[0].thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit.contain, + child:(model.finalProducts[index].images != null && + model.finalProducts[index].images.length > 0) + ? Image.network( + model.finalProducts[index].images[0].src, + fit: BoxFit.cover, height: 80, + width: 80, + + ) + : Image.asset( + "assets/images/no_image.png", + fit: BoxFit.cover, + height: 80, + width: 80, ), +// Image.network( +// model.finalProducts[index].images.isNotEmpty +// ? model.finalProducts[index].images[0].thumb +// : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', +// fit: BoxFit.contain, +// height: 80, +// ), ), ], ), Column( children: [ Container( - width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5.3 : 0, + width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 4.3 : 0, padding: EdgeInsets.all(4), decoration: BoxDecoration( color: Color(0xffb23838), - borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), + //borderRadius: BorderRadius.only(topLeft: Radius.circular(5)), ), child:model.finalProducts[index].rxMessage != null ? Texts( projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, color: Colors.white, regular: true, - fontSize: 10, + fontSize: 8, fontWeight: FontWeight.w600, ) : Texts(""), diff --git a/lib/pages/pharmacies/compare-list.dart b/lib/pages/pharmacies/compare-list.dart index afa5382f..0b1aa73d 100644 --- a/lib/pages/pharmacies/compare-list.dart +++ b/lib/pages/pharmacies/compare-list.dart @@ -16,7 +16,7 @@ class CompareList with ChangeNotifier { ); } else { for (int i = 0; i < _product.length; i++) { - if (_product.length <= 4 && _product[i].id != data.id) { + if (_product.length < 4 && _product[i].id != data.id) { _product.add(data); AppToast.showSuccessToast(message:TranslationBase.of(context).addToCompareMsg // 'You have added a product to the Compare list' diff --git a/lib/pages/pharmacies/compare.dart b/lib/pages/pharmacies/compare.dart index f458304f..34b21001 100644 --- a/lib/pages/pharmacies/compare.dart +++ b/lib/pages/pharmacies/compare.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -113,6 +114,7 @@ class slideDetail extends StatefulWidget { class _slideDetailState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return ListView.builder( scrollDirection: Axis.horizontal, itemCount: widget.data.length, @@ -122,7 +124,7 @@ class _slideDetailState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - height: 750, + height: 760, width: 150, margin: EdgeInsets.symmetric(horizontal: 10.0), decoration: BoxDecoration( @@ -171,10 +173,10 @@ class _slideDetailState extends State { ), Container( margin: EdgeInsets.all(5), - child: Align( + child:Align( alignment: Alignment.topLeft, child: RichText( - text: languageID == "ar"? TextSpan( + text: projectViewModel.isArabic ? TextSpan( text: widget.data[index].namen, style: TextStyle( fontWeight: FontWeight.bold, @@ -193,8 +195,9 @@ class _slideDetailState extends State { ), Container( margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, child: RichText( text: TextSpan( text: "SAR ${widget.data[index].price.toString()}", @@ -204,8 +207,20 @@ class _slideDetailState extends State { fontWeight: FontWeight.bold), ), ), + ): + Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: "SAR ${widget.data[index].price.toString()}", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), ), ), + ), Padding( padding: EdgeInsets.only(top: 8.0), child: Container( @@ -216,58 +231,61 @@ class _slideDetailState extends State { ), Container( margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, child: RichText( - text: languageID == "ar"? TextSpan( + text: TextSpan( text: widget.data[index].specifications != null ? - widget.data[index].specifications[0].nameN : -// "No data", - TranslationBase.of(context).no_data, + widget.data[index].specifications[0].nameN :"", style: TextStyle( fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), ) - :TextSpan( + ), + ): Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( text: widget.data[index].specifications != null ? - widget.data[index].specifications[0].name : -// "No data", - TranslationBase.of(context).no_data, + widget.data[index].specifications[0].name :"", style: TextStyle( fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), - ), + ) ), - ), + ) ), Container( margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, child: RichText( - text: languageID == "ar"? TextSpan( + text:TextSpan( text: widget.data[index].specifications != null ? - widget.data[index].specifications[0].defaultValuen : -// "No data", - TranslationBase.of(context).no_data, + widget.data[index].specifications[0].defaultValuen:"", style: TextStyle( color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), - ):TextSpan( + ) + ), + ):Align( + alignment: Alignment.topLeft, + child: RichText( + text:TextSpan( text: widget.data[index].specifications != null ? - widget.data[index].specifications[0].defaultValue : -// "No data", - TranslationBase.of(context).no_data, + widget.data[index].specifications[0].defaultValue:"", style: TextStyle( color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), - ), + ) ), - ), + ) ), Padding( padding: EdgeInsets.only(top: 8.0), @@ -278,58 +296,62 @@ class _slideDetailState extends State { ), ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[1].nameN : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[1].name : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[1].nameN :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) ), - ), - ), + ): Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[1].name :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) + ), + ) ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[1].defaultValuen : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[1].defaultValue : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[1].defaultValuen:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) ), - ), - ), + ):Align( + alignment: Alignment.topLeft, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[1].defaultValue:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) + ), + ) ), Padding( padding: EdgeInsets.only(top: 8.0), @@ -340,58 +362,62 @@ class _slideDetailState extends State { ), ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[2].nameN : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[2].name : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[2].nameN :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) ), - ), - ), + ): Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[2].name :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) + ), + ) ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[2].defaultValuen : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[2].defaultValue : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[2].defaultValuen:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) ), - ), - ), + ):Align( + alignment: Alignment.topLeft, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[2].defaultValue:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) + ), + ) ), Padding( padding: EdgeInsets.only(top: 8.0), @@ -402,58 +428,62 @@ class _slideDetailState extends State { ), ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[3].nameN : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[3].name : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[3].nameN :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) ), - ), - ), + ): Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[3].name :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) + ), + ) ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[3].defaultValuen : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[3].defaultValue : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[3].defaultValuen:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) ), - ), - ), + ):Align( + alignment: Alignment.topLeft, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[3].defaultValue:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) + ), + ) ), Padding( padding: EdgeInsets.only(top: 8.0), @@ -464,58 +494,62 @@ class _slideDetailState extends State { ), ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[4].nameN : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[4].name : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[4].nameN :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) ), - ), - ), + ): Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[4].name :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) + ), + ) ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[4].defaultValuen : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[4].defaultValue : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[4].defaultValuen:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) ), - ), - ), + ):Align( + alignment: Alignment.topLeft, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[4].defaultValue:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) + ), + ) ), Padding( padding: EdgeInsets.only(top: 8.0), @@ -526,67 +560,64 @@ class _slideDetailState extends State { ), ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[5].nameN : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[5].name : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[5].nameN :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) ), - ), - ), + ): Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[5].name :"", + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ) + ), + ) ), Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: languageID == "ar"? TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[5].defaultValuen : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), - ):TextSpan( - text: widget.data[index].specifications != null ? - widget.data[index].specifications[5].defaultValue : -// "No data", - TranslationBase.of(context).no_data, - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + margin: EdgeInsets.all(5), + child: projectViewModel.isArabic ? + Align( + alignment: Alignment.topRight, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[5].defaultValuen:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) ), - ), - ), - ), - Padding( - padding: EdgeInsets.only(top: 8.0), - child: Container( - height: 1.0, - width: 300.0, - color: Colors.grey, - ), + ):Align( + alignment: Alignment.topLeft, + child: RichText( + text:TextSpan( + text: widget.data[index].specifications != null ? + widget.data[index].specifications[5].defaultValue:"", + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ) + ), + ) ), + ], ), ), diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart index 20b65c55..681be5a5 100644 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -354,12 +354,12 @@ class LakumHomeButtons extends StatelessWidget { children: [ Expanded( child: InkWell( - onTap: () { - print("Account activate click"); - Navigator.push( - context, FadePage(page: LakumActivationVidaPage())) - .then((result) => {model.getLacumGroupData()}); - }, +// onTap: () { +// print("Account activate click"); +// Navigator.push( +// context, FadePage(page: LakumActivationVidaPage())) +// .then((result) => {model.getLacumGroupData()}); +// }, child: Container( padding: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( diff --git a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart index 3a6f5c8d..a71a5a1e 100644 --- a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart +++ b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart @@ -126,15 +126,45 @@ class _ProductNameAndPriceState extends State { widget.stockAvailability != null && !widget.isStockAvailable && widget.customerId != null - ? IconButton( - iconSize: 25, - icon: Icon(Icons.notifications_active), - color: new Color(0xff2E303A), - onPressed: () { - widget.notifyMeWhenAvailable( - context, widget.item.id); - }, - ) + ? Container( + child: Row( + children: [ + IconButton( + iconSize: 25, + icon: Icon(Icons.notifications_active), + color: new Color(0xff2E303A), + onPressed: () { + widget.notifyMeWhenAvailable( + context, widget.item.id); + }, + ), + IconButton( + icon: Icon(!widget.isInWishList + ? Icons.favorite_border + : Icons.favorite), + color: !widget.isInWishList + ? Color(0xff2E303A) + : Color(0xffD02127), + onPressed: () async { + { + if (widget.customerId != null) { + if (!widget.isInWishList) { + await widget + .addToWishlistFunction(widget.item.id); + } else { + await widget.deleteFromWishlistFunction( + widget.item.id); + } + } else { + return; + } + setState(() {}); + } + }, + ) + ], + ), + ) : IconButton( icon: Icon(!widget.isInWishList ? Icons.favorite_border diff --git a/lib/pages/pharmacies/search_brands_page.dart b/lib/pages/pharmacies/search_brands_page.dart index 7ffe8d26..c452f82f 100644 --- a/lib/pages/pharmacies/search_brands_page.dart +++ b/lib/pages/pharmacies/search_brands_page.dart @@ -54,20 +54,6 @@ class _SearchBrandsPageState extends State { fontSize: 19.0, prefixIcon: Icon(Icons.search), inputAction: TextInputAction.search, - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp(r'([A-Za-z0-9 a space])') -// ("[\u0621-\u064a-\ ]") - ) - ], - 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); }, diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index bb680864..04c67079 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -34,6 +34,8 @@ class _ProductReviewPageState extends State { appBarTitle: TranslationBase.of(context).writeReview, isShowAppBar: true, isPharmacy: true, + showPharmacyCart: false, + showHomeAppBarIcon: false, body: Container( color: Colors.white, child: !finishReview ? SingleChildScrollView( diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 6a423b82..39b5e4ea 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -175,7 +175,7 @@ class _PharmacyAddressesState extends State { } } -class AddressItemWidget extends StatelessWidget { +class AddressItemWidget extends StatefulWidget { final PharmacyAddressesViewModel model; final AddressInfo address; final Function selectAddress; @@ -184,6 +184,11 @@ class AddressItemWidget extends StatelessWidget { AddressItemWidget(this.model, this.address, this.selectAddress, this.isSelected, this.onTabEditAddress); + @override + _AddressItemWidgetState createState() => _AddressItemWidgetState(); +} + +class _AddressItemWidgetState extends State { @override Widget build(BuildContext context) { return Container( @@ -199,14 +204,14 @@ class AddressItemWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( - onTap: selectAddress, + onTap: widget.selectAddress, child: Container( margin: EdgeInsets.only(left: 16, right: 16), child: Padding( padding: const EdgeInsets.all(5.0), child: Container( decoration: new BoxDecoration( - color: !isSelected ? Colors.white : Colors.green, + color: !widget.isSelected ? Colors.white : Colors.green, shape: BoxShape.circle, border: Border.all(color: Colors.grey, style: BorderStyle.solid, width: 1.0), ), @@ -214,7 +219,7 @@ class AddressItemWidget extends StatelessWidget { padding: const EdgeInsets.all(0.0), child: Icon( Icons.check, - color: isSelected ? Colors.white : Colors.transparent, + color: widget.isSelected ? Colors.white : Colors.transparent, size: 25, ), ), @@ -234,7 +239,7 @@ class AddressItemWidget extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(vertical: 0), child: Texts( - "${address.firstName} ${address.lastName}", + "${widget.address.firstName} ${widget.address.lastName}", fontSize: 14, fontWeight: FontWeight.bold, color: Colors.black, @@ -243,7 +248,7 @@ class AddressItemWidget extends StatelessWidget { Padding( padding: const EdgeInsets.symmetric(vertical: 4), child: Texts( - "${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}", + "${widget.address.address1} ${widget.address.address2} ${widget.address.address2},, ${widget.address.city}, ${widget.address.country} ${widget.address.zipPostalCode}", fontSize: 12, fontWeight: FontWeight.normal, color: Colors.grey.shade500, @@ -260,7 +265,7 @@ class AddressItemWidget extends StatelessWidget { ), ), Texts( - "${address.phoneNumber}", + "${widget.address.phoneNumber}", fontSize: 14, fontWeight: FontWeight.bold, color: Colors.grey, @@ -281,7 +286,7 @@ class AddressItemWidget extends StatelessWidget { borderColor: Colors.transparent, textColor: Color(0x990000FF), handler: () { - onTabEditAddress(address); + widget.onTabEditAddress(widget.address); }, icon: Icon( Icons.edit, @@ -306,19 +311,23 @@ class AddressItemWidget extends StatelessWidget { textColor: Color(0x99FF0000), handler: () { ConfirmDialog dialog = new ConfirmDialog( - context: context, - title: "Are you sure want to delete", - confirmMessage: "${address.address1} ${address.address2}", + // context: context, + title: TranslationBase.of(context).deleteAddress, + //"Are you sure want to delete", + confirmMessage: "${widget.address.address1} ${widget.address.address2}", okText: TranslationBase.of(context).delete, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - model.deleteAddresses(address).then((_) { + widget.model.deleteAddresses(widget.address).then((_) { ConfirmDialog.closeAlertDialog(context); - AppToast.showErrorToast(message: "Address has been deleted"); + AppToast.showErrorToast(message: TranslationBase.of(context).deletedAddress, + // "Address has been deleted" + ); }) }, cancelFunction: () => {}); dialog.showAlertDialog(context); + setState(() {}); }, icon: Icon( Icons.delete, diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart index e69de29b..03a6c29d 100644 --- a/lib/pages/pharmacy/pharmacyContacts.dart +++ b/lib/pages/pharmacy/pharmacyContacts.dart @@ -0,0 +1,267 @@ + +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +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 'dart:io' show Platform; + + + +class pharmacyContactsPage extends StatefulWidget { + + + + @override + _pharmacyContactsPageState createState() => _pharmacyContactsPageState(); +} + +class _pharmacyContactsPageState extends State { + + + + @override + Widget build(BuildContext context) { + final latitude="24.704016"; + final longitude="46.676691"; + final phone="+966112833400"; + final whatsApp="+699558434444"; + final whatappURL_android="whatsapp://send?phone="+whatsApp; + final whatappURL_ios="https://wa.me/$whatsApp"; + + return AppScaffold( + appBarTitle: TranslationBase.of(context).contactUs, + isShowAppBar: true, + isShowDecPage: false, + isPharmacy: true, + showPharmacyCart: false, + showHomeAppBarIcon: false, + isMainPharmacyPages: true, + body:Column( + children: [ + Card( + elevation: 2, + shape: RoundedRectangleBorder( + side: BorderSide( + color: Colors.grey[300], width: 2), + borderRadius: BorderRadius.circular(10), + ), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 8, + ), + child: Container( + margin: EdgeInsets.all(10), + padding:EdgeInsets.fromLTRB(5,15,5,15), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(15),), + ), + child: Column( + children: [ + 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", + style: TextStyle( + color: Colors.grey[700], + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing:-0.68 + ) + ), + ), + ), + SizedBox( + height: 35, + ), + Row( + children: [ + InkWell( + onTap: () { + launch("tel://"+phone); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/call.svg', + width: 20, + height: 20, + ),), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).phone, + style: TextStyle( + color: Colors.grey[700], + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing:-0.68 + ) + ), + SizedBox( + width: 30, + ), + Text( + "+966 " + " -11- 2833400", + style: TextStyle( + color: Colors.grey[700], + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing:-0.68 + ) + ), + ], + ), + SizedBox( + height: 30, + ), + Row( + children: [ + InkWell( + onTap: () { + // launch('whatsapp://send?phone='+whatsApp); + openWhatsApp(); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/whatsapp.svg', + width: 20, + height: 20, + ), + ), + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).whatsApp, + style: TextStyle( + color: Colors.grey[700], + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing:-0.68 + ) + ), + SizedBox( + width: 30, + ), + Text( + "+966 " + " 558434444", + style: TextStyle( + color: Colors.grey[700], + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing:-0.68 + ) + ), + ], + ), + SizedBox( + height: 30, + ), + Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + children: [ + InkWell( + onTap: () { + MapsLauncher.launchCoordinates(double.parse(latitude), + double.parse(longitude)); + }, + child: SvgPicture.asset( + 'assets/images/pharmacy/location.svg', + width: 20, + height: 20, + ), + ), + SizedBox( + width: 20, + ), + Expanded( + child: Text( + "P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", + style: TextStyle( + color: Colors.grey[700], + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing:-0.68 + ) + ), + ), + ], + ), + ), + SizedBox( + height: 50, + ), + Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + icon: new Image.asset('assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 48, + onPressed: () { + setState(() { + launch("https://facebook.com/HMG"); + // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 48, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/pharmacy/instagram.png'), + tooltip: 'Instagram', + iconSize: 48, + onPressed: () { + setState(() { + launch("https://instagram.com/HMG"); + }); + }, + ), + + ] + ), + ) + ], + ), + ), + ), + ], + ), + ); + + } + + openWhatsApp() async{ + // bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS; + var whatsapp ="+699558434444"; + var whatsappURL_android = "whatsapp://send?phone="+whatsapp; + var whatappURL_ios ="https://wa.me/$whatsapp"; + if(Platform.isIOS){ + // for iOS phone only + if( await canLaunch(whatappURL_ios)){ + await launch(whatappURL_ios, forceSafariVC: false); + }else{ + } + + }else{ + // android + if( await canLaunch(whatsappURL_android)){ + await launch(whatsappURL_android); + }else{ + } + } + + } +} diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 72fa43dc..25c6e7d2 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-con import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyContacts.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -548,7 +549,7 @@ class _ProfilePageState extends State { ), InkWell( onTap: () { - Navigator.push(context, FadePage(page: LiveChatPage())); + Navigator.push(context, FadePage(page: pharmacyContactsPage())); }, child: Row( children: [ diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart index 8ec9f014..375265fc 100644 --- a/lib/pages/search_products_page.dart +++ b/lib/pages/search_products_page.dart @@ -61,22 +61,6 @@ class _SearchProductsPageState extends State { 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); }, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 9484c69d..635dd5ed 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -995,10 +995,18 @@ class TranslationBase { String get edit => localizedValues['edit'][locale.languageCode]; + String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + + String get phone => localizedValues['phone'][locale.languageCode]; + String get delete => localizedValues['delete'][locale.languageCode]; String get addAddress => localizedValues['addAddress'][locale.languageCode]; + String get deleteAddress => localizedValues['deleteAddress'][locale.languageCode]; + + String get deletedAddress => localizedValues['deletedAddress'][locale.languageCode]; + String get addNewAddress => localizedValues['addNewAddress'][locale.languageCode]; String get order => localizedValues['order'][locale.languageCode]; diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 23a6dd9b..48c66dd7 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 ||status == 994 && this.isOrderDetails == true) Expanded( child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, From c84d1cadada054ce0e1558748691104a3dd2c1ff Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 30 Nov 2021 12:21:36 +0300 Subject: [PATCH 3/4] fix address issue --- lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 39b5e4ea..fb6d368c 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -327,7 +327,9 @@ class _AddressItemWidgetState extends State { }, cancelFunction: () => {}); dialog.showAlertDialog(context); - setState(() {}); + setState(() { + widget.model.deleteAddresses(widget.address); + }); }, icon: Icon( Icons.delete, From 1b9e3b75bd2a695a90592be12db443cf10cc29e6 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Thu, 2 Dec 2021 08:57:24 +0300 Subject: [PATCH 4/4] fix issue of navigation --- lib/widgets/hospital_location.dart | 40 +++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/lib/widgets/hospital_location.dart b/lib/widgets/hospital_location.dart index 8ba7b4bd..780aa32e 100644 --- a/lib/widgets/hospital_location.dart +++ b/lib/widgets/hospital_location.dart @@ -8,6 +8,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'avatar/large_avatar.dart'; import 'my_rich_text.dart'; +import 'dart:io' show Platform; class HospitalLocation extends StatelessWidget { final GetHMGLocationsModel location; @@ -74,7 +75,9 @@ class HospitalLocation extends StatelessWidget { Column( children: [ contactButton(Icons.location_on, TranslationBase.of(context).locationa, () { - MapsLauncher.launchCoordinates(double.parse(location.latitude), double.parse(location.longitude), location.locationName); + // MapsLauncher.launchCoordinates(double.parse(location.latitude), double.parse(location.longitude), location.locationName); + // launchMap( double.parse(location.latitude), double.parse(location.longitude)); + navigateTo(double.parse(location.latitude), double.parse(location.longitude)); }), SizedBox(height: 10), contactButton(Icons.call, TranslationBase.of(context).callNow, () { @@ -107,4 +110,39 @@ class HospitalLocation extends StatelessWidget { ), ); } + + static void navigateTo(double latitude, double longitude) async { + var uri = Uri.parse("google.navigation:q=$latitude,$longitude&mode=d"); + if (await canLaunch(uri.toString())) { + await launch(uri.toString()); + } else { + throw 'Could not launch ${uri.toString()}'; + } + } + +// launchMap(latitude, longitude) async { +// var url = ''; +// var urlAppleMaps = ''; +// if (Platform.isAndroid) { +// url = "https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}"; +// } else { +// urlAppleMaps = 'https://maps.apple.com/?q=$latitude,$longitude'; +// url = "comgooglemaps://?saddr=&daddr=$latitude,$longitude&directionsmode=driving"; +// if (await canLaunch(url)) { +// await launch(url); +// } else { +// throw 'Could not launch $url'; +// } +// } +// +// if (await canLaunch(url)) { +// await launch(url); +// } else if (await canLaunch(urlAppleMaps)) { +// await launch(urlAppleMaps); +// } else { +// throw 'Could not launch $url'; +// } +// } + + }