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 00000000..a03f47bd
Binary files /dev/null and b/assets/images/pharmacy/instagram.png differ
diff --git a/assets/images/pharmacy/location.svg b/assets/images/pharmacy/location.svg
new file mode 100644
index 00000000..a52cc72e
--- /dev/null
+++ b/assets/images/pharmacy/location.svg
@@ -0,0 +1,3 @@
+
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/ios/Runner/Info.plist b/ios/Runner/Info.plist
index ec89ac71..02eb80d9 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -96,3 +96,19 @@
+
+LSApplicationQueriesSchemes
+
+ comgooglemaps
+ baidumap
+ iosamap
+ waze
+ yandexmaps
+ yandexnavi
+ citymapper
+ mapswithme
+ osmandmaps
+ dgis
+ qqmap
+ here-location
+
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/config/localized_values.dart b/lib/config/localized_values.dart
index babdd9c1..7e0f8166 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/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart
index 2fbcb832..8e24a04d 100644
--- a/lib/core/model/labs/patient_lab_special_result.dart
+++ b/lib/core/model/labs/patient_lab_special_result.dart
@@ -3,7 +3,7 @@ class PatientLabSpecialResult {
String moduleID;
String resultData;
String resultDataHTML;
- Null resultDataTxt;
+ dynamic resultDataTxt;
PatientLabSpecialResult(
{this.invoiceNo,
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/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart
index f648025d..eb14805c 100644
--- a/lib/pages/BookAppointment/BookConfirm.dart
+++ b/lib/pages/BookAppointment/BookConfirm.dart
@@ -90,7 +90,6 @@ class _BookConfirmState extends State {
null,
widget.doctor.noOfPatientsRate,
"",
-
),
isNeedToShowButton: false,
),
@@ -201,7 +200,7 @@ class _BookConfirmState extends State {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () async {
- if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
+ if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
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/insurance/insurance_approval_detail_screen.dart b/lib/pages/insurance/insurance_approval_detail_screen.dart
index fa6d0f5a..c5f84602 100644
--- a/lib/pages/insurance/insurance_approval_detail_screen.dart
+++ b/lib/pages/insurance/insurance_approval_detail_screen.dart
@@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget {
MyRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic),
SizedBox(height: 6),
- MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "",
+ MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn)) ?? "",
projectViewModel.isArabic),
- MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "",
+ MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate)) ?? "",
projectViewModel.isArabic),
],
),
diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart
index 52ce35c8..bd665046 100644
--- a/lib/pages/insurance/insurance_approval_screen.dart
+++ b/lib/pages/insurance/insurance_approval_screen.dart
@@ -140,7 +140,7 @@ class _InsuranceApprovalState extends State {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
- MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach ?? "",
+ MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName != null ? model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach : "",
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic),
],
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/cart-page/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart
index df44c706..7a252bd6 100644
--- a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart
+++ b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart
@@ -412,7 +412,7 @@ class _OrderBottomWidgetState extends State {
if (widget.model.isCartItemsOutOfStock())
{AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)}
else
- {_navigateToAddressPage(widget.model.user.patientIdentificationNo)}
+ {_navigateToAddressPage(projectProvider.user.patientIdentificationNo)}
}
: null,
child: new Text(
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/availability_info.dart b/lib/pages/pharmacies/screens/product-details/availability_info.dart
index a5ba0956..08c6d5de 100644
--- a/lib/pages/pharmacies/screens/product-details/availability_info.dart
+++ b/lib/pages/pharmacies/screens/product-details/availability_info.dart
@@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
+import 'package:map_launcher/map_launcher.dart';
class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel;
@@ -54,7 +55,14 @@ class AvailabilityInfo extends StatelessWidget {
icon: Icon(Icons.location_on),
color: Colors.red,
onPressed: () {
- MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
+ MapLauncher.showMarker(
+ mapType: MapType.google,
+ coords: Coords(double.parse(previousModel.productLocationService[index].latitude),
+ double.parse(previousModel.productLocationService[index].longitude)),
+ title: previousModel.productLocationService[index].locationDescription,
+// description: location.locationName,
+ );
+ // MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
},
),
),
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..5d974cc4 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,22 @@ class _FooterWidgetState extends State {
);
}
+ bool isBuyNowDisable(){
+ return (!widget.isAvailable && widget.quantity > 0) ||
+ (widget.quantity > widget.quantityLimit) ||
+ widget.item.isRx;
+
+
+ }
+
+ bool isAddToCartDisable(){
+ 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/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/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/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..c5edac52 100644
--- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
+++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart
@@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
@@ -15,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
///TODO Elham* split this to tow files
class PharmacyAddressesPage extends StatefulWidget {
@@ -44,6 +46,7 @@ class _PharmacyAddressesState extends State {
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
+ ProjectViewModel projectProvider = Provider.of(context);
return BaseView(
onModelReady: (model) => model.getAddressesList(),
@@ -127,7 +130,7 @@ class _PharmacyAddressesState extends State {
GifLoaderDialogUtils.showMyDialog(context);
- await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo);
+ await widget.orderPreviewViewModel.getInformationsByAddress(projectProvider.user.patientIdentificationNo);
if (widget.orderPreviewViewModel.error == "") {
await widget.orderPreviewViewModel.getShoppingCart();
GifLoaderDialogUtils.hideDialog(context);
@@ -175,7 +178,7 @@ class _PharmacyAddressesState extends State {
}
}
-class AddressItemWidget extends StatelessWidget {
+class AddressItemWidget extends StatefulWidget {
final PharmacyAddressesViewModel model;
final AddressInfo address;
final Function selectAddress;
@@ -184,6 +187,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 +207,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 +222,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 +242,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 +251,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 +268,7 @@ class AddressItemWidget extends StatelessWidget {
),
),
Texts(
- "${address.phoneNumber}",
+ "${widget.address.phoneNumber}",
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.grey,
@@ -281,7 +289,7 @@ class AddressItemWidget extends StatelessWidget {
borderColor: Colors.transparent,
textColor: Color(0x990000FF),
handler: () {
- onTabEditAddress(address);
+ widget.onTabEditAddress(widget.address);
},
icon: Icon(
Icons.edit,
@@ -306,19 +314,25 @@ 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(() {
+ widget.model.deleteAddresses(widget.address);
+ });
},
icon: Icon(
Icons.delete,
diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart
new file mode 100644
index 00000000..03a6c29d
--- /dev/null
+++ 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..79b3025e 100644
--- a/lib/pages/search_products_page.dart
+++ b/lib/pages/search_products_page.dart
@@ -11,12 +11,14 @@ 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 +29,8 @@ class _SearchProductsPageState extends State {
final textController = TextEditingController();
final _formKey = GlobalKey();
String msg = '';
+ String validText = "";
+ bool isTextValid = true;
@override
Widget build(BuildContext context) {
@@ -61,22 +65,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);
},
@@ -86,16 +74,18 @@ class _SearchProductsPageState extends State {
msg = TranslationBase.of(context).noResultFound;
},
controller: textController,
-// validator: (value) {
-// if (value.isEmpty) {
-//// return 'please Enter Product Name';
-// return TranslationBase.of(context).pleaseEnterProductName;
-// }
-// return null;
-// },
),
+ // SizedBox(
+ // width: 10.0,
+ // ),
+ // if(!isTextValid)
+ // AppText( TranslationBase.of(context)
+ // .noArabicLetters, color: Colors.red,),
+ // ],
+ // ),
),
),
+
SizedBox(
width: 10.0,
),
@@ -223,16 +213,27 @@ class _SearchProductsPageState extends State {
Radius.circular(
6)),
),
- child: model.searchList[index].rxMessage != null
+ child: model.searchList[index]
+ .rxMessage !=
+ null
? Texts(
- projectProvider.isArabic
- ? model.searchList[index].rxMessagen
- : model.searchList[index].rxMessage,
- color: Colors.white,
- regular: true,
- fontSize: 10,
- fontWeight: FontWeight.w400,
- ): Texts(""),
+ projectProvider
+ .isArabic
+ ? model
+ .searchList[
+ index]
+ .rxMessagen
+ : model
+ .searchList[
+ index]
+ .rxMessage,
+ color: Colors.white,
+ regular: true,
+ fontSize: 10,
+ fontWeight:
+ FontWeight.w400,
+ )
+ : Texts(""),
// Texts(
// model.searchList[index]
// .rxMessage !=
@@ -258,11 +259,16 @@ class _SearchProductsPageState extends State {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
- Texts(projectProvider.isArabic
- ? model.searchList[index].namen
- :model.searchList[index].name,
+ Texts(
+ projectProvider.isArabic
+ ? model
+ .searchList[index]
+ .namen
+ : model
+ .searchList[index]
+ .name,
- // model.searchList[index].name,
+ // model.searchList[index].name,
regular: true,
fontSize: 12,
fontWeight: FontWeight.w400,
@@ -338,6 +344,10 @@ 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())
diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart
index 1030c709..41475bab 100644
--- a/lib/pages/vaccine/my_vaccines_screen.dart
+++ b/lib/pages/vaccine/my_vaccines_screen.dart
@@ -76,38 +76,37 @@ class _MyVaccinesState extends State {
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Expanded(
- child: DefaultButton(
- TranslationBase.of(context).availability,
- () {
- // Navigator.push(context, FadePage(page: MyVaccinesItemPage()));
- },
- color: Color(0xffEAEAEA),
- textColor: Color(0xff000000),
- ),
- ),
- SizedBox(width: 8),
- Expanded(
- child: DefaultButton(
- TranslationBase.of(context).sendEmail,
- () {
- showDialog(
- context: context,
- child: ConfirmSendEmailDialog(
- email: projectViewModel.user.emailAddress,
- onTapSendEmail: () {
- model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
- },
- ),
- );
- },
- ),
+ child:
+ // Row(
+ // mainAxisSize: MainAxisSize.min,
+ // children: [
+ // Expanded(
+ // child: DefaultButton(
+ // TranslationBase.of(context).availability,
+ // () {
+ // // Navigator.push(context, FadePage(page: MyVaccinesItemPage()));
+ // },
+ // color: Color(0xffEAEAEA),
+ // textColor: Color(0xff000000),
+ // ),
+ // ),
+ // SizedBox(width: 8),
+ DefaultButton(
+ TranslationBase.of(context).sendEmail,
+ () {
+ showDialog(
+ context: context,
+ child: ConfirmSendEmailDialog(
+ email: projectViewModel.user.emailAddress,
+ onTapSendEmail: () {
+ model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
+ },
+ ),
+ );
+ },
),
- ],
- ),
+ // ],
+ // ),
),
),
);
diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart
index 69b45410..cfe30e91 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/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
diff --git a/lib/widgets/hospital_location.dart b/lib/widgets/hospital_location.dart
index 8ba7b4bd..e9395906 100644
--- a/lib/widgets/hospital_location.dart
+++ b/lib/widgets/hospital_location.dart
@@ -5,15 +5,18 @@ import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
+import 'package:map_launcher/map_launcher.dart';
import 'avatar/large_avatar.dart';
import 'my_rich_text.dart';
+import 'dart:io' show Platform;
class HospitalLocation extends StatelessWidget {
final GetHMGLocationsModel location;
final bool showCity;
final String waitingTime;
+
HospitalLocation(this.location, {Key key, this.showCity = false, this.waitingTime}) : super(key: key);
@override
@@ -74,7 +77,13 @@ 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);
+ MapLauncher.showMarker(
+ mapType: MapType.google,
+ coords: Coords(double.parse(location.latitude), double.parse(location.longitude)),
+ title: location.locationName,
+// description: location.locationName,
+ );
}),
SizedBox(height: 10),
contactButton(Icons.call, TranslationBase.of(context).callNow, () {
@@ -107,4 +116,7 @@ class HospitalLocation extends StatelessWidget {
),
);
}
+
+
+
}
diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart
index c5b45b77..75b750d4 100644
--- a/lib/widgets/others/app_scaffold_widget.dart
+++ b/lib/widgets/others/app_scaffold_widget.dart
@@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
-import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@@ -135,8 +134,7 @@ class AppScaffold extends StatefulWidget {
}
class _AppScaffoldState extends State {
- AuthenticatedUserObject authenticatedUserObject =
- locator();
+ AuthenticatedUserObject authenticatedUserObject = locator();
AppBarWidget appBar;
@override
@@ -185,8 +183,7 @@ class _AppScaffoldState extends State {
builder: (BuildContext context) {
return InkWell(
onTap: () {
- Provider.of(context, listen: false)
- .changeCurrentTab(0);
+ Provider.of(context, listen: false).changeCurrentTab(0);
},
child: Container(
height: 2.0,
@@ -216,12 +213,9 @@ class _AppScaffoldState extends State {
AppGlobal.context = context;
PharmacyPagesViewModel pagesViewModel = Provider.of(context);
- bool isUserNotLogin =
- (!Provider.of(context, listen: false).isLogin &&
- widget.isShowDecPage);
+ bool isUserNotLogin = (!Provider.of(context, listen: false).isLogin && widget.isShowDecPage);
return Scaffold(
- backgroundColor:
- widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
+ backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
// appBar: widget.isShowPharmacyAppbar
// ? pharmacyAppbar()
@@ -254,8 +248,7 @@ class _AppScaffoldState extends State {
isPharmacy: widget.isPharmacy,
showPharmacyCart: widget.showPharmacyCart,
isOfferPackages: widget.isOfferPackages,
- showOfferPackagesCart:
- widget.showOfferPackagesCart,
+ showOfferPackagesCart: widget.showOfferPackagesCart,
isShowDecPage: widget.isShowDecPage,
backButtonTab: widget.backButtonTab,
)
@@ -294,10 +287,7 @@ class _AppScaffoldState extends State {
widget.changeCurrentTab(value);
} else {
Navigator.pushAndRemoveUntil(
- locator().navigatorKey.currentContext,
- MaterialPageRoute(
- builder: (context) => LandingPagePharmacy(currentTab: value)),
- (Route r) => false);
+ locator().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: value)), (Route r) => false);
}
}
@@ -307,9 +297,7 @@ class _AppScaffoldState 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);
@@ -319,8 +307,7 @@ class _AppScaffoldState 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) {}
}
@@ -330,10 +317,7 @@ class _AppScaffoldState extends State {
}
buildBodyWidget(context) {
- return Stack(children: [
- widget.body,
- widget.isHelp == true ? RobotIcon() : Container()
- ]);
+ return Stack(children: [widget.body, widget.isHelp == true ? RobotIcon() : Container()]);
}
}
@@ -347,16 +331,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
final List appBarIcons;
Function onTap;
- NewAppBarWidget(
- {Key key,
- this.showTitle = false,
- this.showDropDown = false,
- this.title = "",
- this.dropDownList,
- this.appBarIcons,
- this.dropdownIndexValue,
- this.dropDownIndexChange,
- this.onTap})
+ NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap})
: super(key: key);
@override
@@ -381,13 +356,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
title,
maxLines: 1,
style: TextStyle(
- fontSize: 24,
- fontFamily:
- (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
- fontWeight: FontWeight.w700,
- color: Color(0xff2B353E),
- letterSpacing: -1.44,
- height: 35 / 24),
+ fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
),
if (showDropDown)
@@ -399,8 +368,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
alignedDropdown: true,
child: DropdownButton(
iconEnabledColor: CustomColors.grey2,
- style: TextStyle(
- color: CustomColors.lightGreyColor, fontSize: 12),
+ style: TextStyle(color: CustomColors.lightGreyColor, fontSize: 12),
dropdownColor: CustomColors.lightGreyColor,
value: dropdownIndexValue,
items: [
@@ -411,9 +379,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
dropDownList[i],
style: TextStyle(
fontSize: 12,
- fontFamily: (projectViewModel.isArabic
- ? 'Cairo'
- : 'Poppins'),
+ fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
fontWeight: FontWeight.w600,
color: Color(0xff2B2E31),
letterSpacing: -.48,
@@ -455,8 +421,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
}
class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
- final AuthenticatedUserObject authenticatedUserObject =
- locator();
+ final AuthenticatedUserObject authenticatedUserObject = locator();
final String appBarTitle;
final bool showHomeAppBarIcon;
@@ -509,22 +474,12 @@ class AppBarWidgetState extends State {
return AppBar(
elevation: 0,
- backgroundColor: widget.isPharmacy
- ? Colors.green
- : Theme.of(context).appBarTheme.color,
+ backgroundColor: widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
- headline6: TextStyle(
- color: Theme.of(context).textTheme.headline1.color,
- fontWeight: FontWeight.bold),
+ headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold),
),
- title: Text(
- widget.authenticatedUserObject.isLogin || !widget.isShowDecPage
- ? widget.appBarTitle.toUpperCase()
- : TranslationBase.of(context).serviceInformationTitle,
- style: TextStyle(
- fontWeight: FontWeight.bold,
- color: Theme.of(context).textTheme.headline1.color,
- fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
+ title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle.toUpperCase() : TranslationBase.of(context).serviceInformationTitle,
+ style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack(
@@ -538,8 +493,7 @@ class AppBarWidgetState extends State {
? IconButton(
icon: Badge(
badgeContent: Text(
- orderPreviewViewModel.cartResponse.quantityCount
- .toString(),
+ orderPreviewViewModel.cartResponse.quantityCount.toString(),
style: TextStyle(color: Colors.white),
),
child: Icon(Icons.shopping_cart)),
@@ -554,10 +508,7 @@ class AppBarWidgetState extends State {
position: BadgePosition.topStart(top: -15, start: -10),
badgeContent: Text(
_badgeText,
- style: TextStyle(
- fontSize: 9,
- color: Colors.white,
- fontWeight: FontWeight.normal),
+ style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal),
),
child: Icon(Icons.shopping_cart)),
color: Colors.white,
@@ -571,10 +522,7 @@ class AppBarWidgetState extends State {
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
- Navigator.pushAndRemoveUntil(
- context,
- MaterialPageRoute(builder: (context) => LandingPage()),
- (Route r) => false);
+ Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false);
// Cart Click Event
if (_onCartClick != null) _onCartClick();
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);
diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart
index 65a77132..5e8c4cf7 100644
--- a/lib/widgets/pharmacy/product_tile.dart
+++ b/lib/widgets/pharmacy/product_tile.dart
@@ -34,25 +34,24 @@ class productTile extends StatelessWidget {
// final VoidCallback deleteWishlistItems;
- productTile({
- this.productName,
- this.productPrice,
- this.productRate,
- this.productReviews,
- this.qyt,
- this.totalPrice,
- this.isOrderDetails = false,
- this.productImage,
- this.showLine = true,
- this.img,
- this.imgs,
- this.status,
- this.product,
- this.productID,
- this.onDelete,
- this.approvedTotalReviews,
- this.isRx
- });
+ productTile(
+ {this.productName,
+ this.productPrice,
+ this.productRate,
+ this.productReviews,
+ this.qyt,
+ this.totalPrice,
+ this.isOrderDetails = false,
+ this.productImage,
+ this.showLine = true,
+ this.img,
+ this.imgs,
+ this.status,
+ this.product,
+ this.productID,
+ this.onDelete,
+ this.approvedTotalReviews,
+ this.isRx});
@override
Widget build(BuildContext context) {
@@ -93,46 +92,59 @@ class productTile extends StatelessWidget {
children: [
Container(
margin: EdgeInsets.all(5),
- child: projectViewModel
- .isArabic ? Align(
- alignment: Alignment.topRight,
- child: RichText(
- text: TextSpan(
- text: productName,
- style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
- ),
- ),
- ): Align(
- alignment: Alignment.topLeft,
- child: RichText(
- text: TextSpan(
- text: productName,
- style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
- ),
- ),
- ),
+ child: projectViewModel.isArabic
+ ? Align(
+ alignment: Alignment.topRight,
+ child: RichText(
+ text: TextSpan(
+ text: productName,
+ style: TextStyle(
+ color: Colors.black54,
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ )
+ : Align(
+ alignment: Alignment.topLeft,
+ child: RichText(
+ text: TextSpan(
+ text: productName,
+ style: TextStyle(
+ color: Colors.black54,
+ fontSize: 15,
+ fontWeight: FontWeight.bold),
+ ),
+ ),
+ ),
),
Container(
margin: EdgeInsets.all(5),
- child: projectViewModel
- .isArabic ? Align(
- alignment: Alignment.topRight,
- child: RichText(
- text: TextSpan(
- text: 'SAR $productPrice',
- style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
- ),
- ),
- )
- :Align(
- alignment: Alignment.topLeft,
- child: RichText(
- text: TextSpan(
- text: 'SAR $productPrice',
- style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
- ),
- ),
- ),
+ child: projectViewModel.isArabic
+ ? Align(
+ alignment: Alignment.topRight,
+ child: RichText(
+ text: TextSpan(
+ text: 'SAR $productPrice',
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ fontSize: 13),
+ ),
+ ),
+ )
+ : Align(
+ alignment: Alignment.topLeft,
+ child: RichText(
+ text: TextSpan(
+ text: 'SAR $productPrice',
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ fontSize: 13),
+ ),
+ ),
+ ),
),
this.isOrderDetails == false
? Row(
@@ -156,7 +168,10 @@ class productTile extends StatelessWidget {
),
Text(
'${approvedTotalReviews} ${TranslationBase.of(context).reviews}',
- style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ color: Colors.grey,
+ fontSize: 13),
),
],
)
@@ -188,13 +203,15 @@ class productTile extends StatelessWidget {
color: Colors.green,
),
onPressed: () async {
- if(isRx == false){
- GifLoaderDialogUtils.showMyDialog(context);
- await addToCartFunction(1, productID, context);
- GifLoaderDialogUtils.hideDialog(context);
- Utils.navigateToCartPage();}
- else {
- AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
+ if (isRx == false) {
+ GifLoaderDialogUtils.showMyDialog(context);
+ await addToCartFunction(1, productID, context);
+ GifLoaderDialogUtils.hideDialog(context);
+ Utils.navigateToCartPage();
+ } else {
+ AppToast.showErrorToast(
+ message: TranslationBase.of(context)
+ .needPrescription);
}
},
),
@@ -213,8 +230,13 @@ class productTile extends StatelessWidget {
margin: EdgeInsets.only(bottom: 5.0),
child: RichText(
text: TextSpan(
- text: TranslationBase.of(context).quantity + "" + '$qyt',
- style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
+ text: TranslationBase.of(context).quantity +
+ "" +
+ '$qyt',
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ color: Colors.grey,
+ fontSize: 13),
),
),
),
@@ -240,7 +262,10 @@ class productTile extends StatelessWidget {
RichText(
text: TextSpan(
text: ' $totalPrice SAR',
- style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 15),
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ color: Colors.black,
+ fontSize: 15),
),
),
],
@@ -280,21 +305,33 @@ class productTile extends StatelessWidget {
// alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
- text: '${productReviews} ${TranslationBase.of(context).reviews}',
+ text:
+ '${productReviews} ${TranslationBase.of(context).reviews}',
// text: '($productReviews reviews)',
- style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
+ style: TextStyle(
+ fontWeight: FontWeight.bold,
+ color: Colors.grey,
+ fontSize: 13),
),
),
),
),
InkWell(
onTap: () {
- Navigator.push(context, FadePage(page: ProductReviewPage(product)));
+ Navigator.push(
+ context, FadePage(page: ProductReviewPage(product)));
},
child: Container(
- padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
+ padding:
+ EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 30.0,
- decoration: BoxDecoration(border: Border.all(color: Colors.orange, style: BorderStyle.solid, width: 1.0), color: Colors.transparent, borderRadius: BorderRadius.circular(5.0)),
+ decoration: BoxDecoration(
+ border: Border.all(
+ color: Colors.orange,
+ style: BorderStyle.solid,
+ width: 1.0),
+ color: Colors.transparent,
+ borderRadius: BorderRadius.circular(5.0)),
child: Text(
TranslationBase.of(context).writeReview,
style: TextStyle(
diff --git a/pubspec.yaml b/pubspec.yaml
index ff6873fc..5b1b0a1f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -143,6 +143,7 @@ dependencies:
#google maps places
google_maps_place_picker: ^1.0.0
+ map_launcher: ^1.1.3
#countdown timer for Upcoming List
flutter_countdown_timer: ^1.6.0