Merge branch 'development_new_design_2.0' into haroon-new-design

merge-update-with-lab-changes
haroon amjad 4 years ago
commit 2670d0be57

@ -50,7 +50,8 @@ const Map localizedValues = {
'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'},
'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'},
'search': {'en': 'Search', 'ar': 'بحث'}, 'search': {'en': 'Search', 'ar': 'بحث'},
'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'}, 'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج '},
'noSearchResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'},
'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'}, 'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'},
'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'},
'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'}, 'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'},
@ -277,6 +278,8 @@ const Map localizedValues = {
"viewAll": {"en": "View All", 'ar': 'عرض الكل'}, "viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"view": {"en": "View", 'ar': 'عرض'}, "view": {"en": "View", 'ar': 'عرض'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
"contactUsLocation": {"en": "P.O.Box: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", 'ar': 'صندوق بريد: 91877 - الرياض 11643 ، طريق الملك فهد - العليا - المملكة العربية السعودية'},
"contactUsTime": {"en": "Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - 8:00 PM", 'ar': " السبت الأربعاء 08:00 ص 10:00 م , الخميس 08:00 ص 08:00 م, الجمعة 02:00 م - 08:00 م"},
"ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"}, "consultation": {"en": "Consultation", "ar": "استشارة"},

@ -1,9 +1,12 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -17,8 +20,11 @@ class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses; final List<Addresses> addresses;
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
OrderPreviewPage({this.addresses, this.model}); OrderPreviewPage({this.addresses, this.model});
@override @override
_OrderPreviewPageState createState() => _OrderPreviewPageState(); _OrderPreviewPageState createState() => _OrderPreviewPageState();
} }
@ -26,6 +32,10 @@ class OrderPreviewPage extends StatefulWidget {
class _OrderPreviewPageState extends State<OrderPreviewPage> { class _OrderPreviewPageState extends State<OrderPreviewPage> {
MyInAppBrowser browser; MyInAppBrowser browser;
bool isLoading = true; bool isLoading = true;
bool isChecked = false;
@override @override
void initState() { void initState() {
@ -40,6 +50,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
}); });
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
@ -71,15 +82,98 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
height: 10, height: 10,
), ),
widget.model.paymentCheckoutData.lacumInformation != null widget.model.paymentCheckoutData.lacumInformation != null
? Container( ? AbsorbPointer(
absorbing: true,
child: Stack(
children: [
Container(
child: Column( child: Column(
children: [ children: [
LakumWidget(widget.model), // LakumWidget(widget.model),
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row(
children: [
Row(
children: [
SizedBox(
height: 24.0,
width: 24.0,
child: Checkbox(
activeColor: CustomColors.green,
value: isChecked,
onChanged: (bool value) {
setState(() {
isChecked = value;
print(isChecked);
if (value){
// isChecked;
PaymentBottomWidget.isChecked = true;
print(value);
}else{
PaymentBottomWidget.isChecked = false;
}
setState(() {
});
});
},
),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
TranslationBase.of(context).useLakumPoints +
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
),
],
),
Expanded(
child: Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"${TranslationBase.of(context).availableBalance}",
fontSize: 12,
fontWeight: FontWeight.bold,
),
Text(
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)
),
],
),
),
],
),
),
),
],
),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
], ],
), ),
),
Container(
height: MediaQuery.of(context).size.height * .10,
color: Colors.white.withOpacity(0.6),
)
],
),
) )
: Container(), : Container(),
Container( Container(
@ -190,7 +284,32 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
isChecked ?
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).lakum}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
],
) : Container(),
isChecked ? const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
): Container(),
isChecked ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
@ -200,7 +319,24 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", " ${TranslationBase.of(context).sar}""${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
" ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -228,9 +364,12 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: PaymentBottomWidget(widget.model), child: PaymentBottomWidget(widget.model),
), ),
); );
} }
changeMainState() { changeMainState() {
setState(() {}); setState(() {});
} }
} }

@ -1,5 +1,8 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-preview.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -9,6 +12,7 @@ import 'package:provider/provider.dart';
class LakumWidget extends StatefulWidget { class LakumWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
LakumWidget(this.model); LakumWidget(this.model);
@override @override
@ -41,6 +45,15 @@ class _LakumWidgetState extends State<LakumWidget> {
setState(() { setState(() {
useLakumWidgets = value; useLakumWidgets = value;
print(useLakumWidgets); print(useLakumWidgets);
// if (value){
// // isChecked;
// OrderPreviewPage.isChecked = true;
// print(value);
// }else{
// OrderPreviewPage.isChecked = false;
// }
setState(() {
});
}); });
}, },
), ),
@ -150,6 +163,25 @@ class _LakumWidgetState extends State<LakumWidget> {
// ), // ),
), ),
), ),
// useLakumWidgets ?
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(
// "${TranslationBase.of(context).lakum}",
// fontSize: 14,
// color: Colors.black,
// fontWeight: FontWeight.w500,
// ),
// Texts(
// "${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance).toStringAsFixed(2)}",
// fontSize: 14,
// color: Colors.black,
// fontWeight: FontWeight.w500,
// ),
// ],
// )
// :Container()
], ],
), ),
); );

@ -16,6 +16,7 @@ import 'package:provider/provider.dart';
class PaymentBottomWidget extends StatelessWidget { class PaymentBottomWidget extends StatelessWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
static bool isChecked = true;
BuildContext context; BuildContext context;
MyInAppBrowser browser; MyInAppBrowser browser;
@ -42,6 +43,12 @@ class PaymentBottomWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 4), margin: EdgeInsets.symmetric(horizontal: 0, vertical: 4),
child: Row( child: Row(
children: [ children: [
isChecked ? Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount - model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xff929295),
):
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,

@ -41,6 +41,9 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
showPharmacyCart: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
@ -105,7 +108,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"0", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
@ -165,7 +168,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"0", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,

@ -44,6 +44,8 @@ class LakumMainPage extends StatelessWidget {
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false, showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
appBarIcons: _buildAppBarICons(context, model), appBarIcons: _buildAppBarICons(context, model),

@ -30,8 +30,13 @@ class FooterWidget extends StatefulWidget {
int quantity; int quantity;
bool isOverQuantity; bool isOverQuantity;
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, this.quantityLimit, this.item, FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity,
{this.quantity, this.isOverQuantity = false, this.addToCartFunction, this.addToShoppingCartFunction, this.model}); this.quantityLimit, this.item,
{this.quantity,
this.isOverQuantity = false,
this.addToCartFunction,
this.addToShoppingCartFunction,
this.model});
@override @override
_FooterWidgetState createState() => _FooterWidgetState(); _FooterWidgetState createState() => _FooterWidgetState();
@ -42,7 +47,8 @@ class _FooterWidgetState extends State<FooterWidget> {
bool showUI = false; bool showUI = false;
static final GlobalKey<FormState> _key = GlobalKey<FormState>(); static final GlobalKey<FormState> _key = GlobalKey<FormState>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@override @override
@ -96,7 +102,11 @@ class _FooterWidgetState extends State<FooterWidget> {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts(TranslationBase.of(context).productQuantity, fontSize: 15, fontWeight: FontWeight.bold, color: Color(0xFF575757)), child: Texts(
TranslationBase.of(context).productQuantity,
fontSize: 15,
fontWeight: FontWeight.bold,
color: Color(0xFF575757)),
), ),
InkWell( InkWell(
child: Icon(Icons.close, color: Colors.black), child: Icon(Icons.close, color: Colors.black),
@ -118,7 +128,11 @@ class _FooterWidgetState extends State<FooterWidget> {
SizedBox( SizedBox(
width: 5, width: 5,
), ),
for (int i = 1; i <= 10; i++) QuantityBox(label: i, onTapFunc: onChangeValue, isSelected: widget.quantity == i), for (int i = 1; i <= 10; i++)
QuantityBox(
label: i,
onTapFunc: onChangeValue,
isSelected: widget.quantity == i),
Container( Container(
width: 100, width: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -129,14 +143,16 @@ class _FooterWidgetState extends State<FooterWidget> {
key: _key, key: _key,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
textAlign: TextAlign.center, textAlign: TextAlign.center,
decoration: InputDecoration(hintText: ' Quantity # '), decoration:
InputDecoration(hintText: ' Quantity # '),
onChanged: (text) { onChanged: (text) {
if (int.tryParse(text) == null) { if (int.tryParse(text) == null) {
text = ''; text = '';
} else { } else {
setState(() { setState(() {
widget.quantity = int.parse(text); widget.quantity = int.parse(text);
if (widget.quantity >= widget.quantityLimit) { if (widget.quantity >=
widget.quantityLimit) {
widget.isOverQuantity = true; widget.isOverQuantity = true;
} else { } else {
widget.isOverQuantity = false; widget.isOverQuantity = false;
@ -224,7 +240,7 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric(vertical: 5.0), margin: EdgeInsets.symmetric(vertical: 4.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart, label: TranslationBase.of(context).addToCart,
disabled: isAddToCartDisable(), disabled: isAddToCartDisable(),
@ -233,12 +249,16 @@ class _FooterWidgetState extends State<FooterWidget> {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
} else } else
await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); await widget.addToCartFunction(
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderRadius: 6, borderRadius: 6,
disableColor: Color(0xFFD6D6D6), disableColor: Color(0xFFD6D6D6),
textColor: isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white, textColor:
isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white,
color: Color(0xFF535353), color: Color(0xFF535353),
), ),
), ),
@ -247,7 +267,7 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric(vertical: 5.0), margin: EdgeInsets.symmetric(vertical: 4.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow, label: TranslationBase.of(context).buyNow,
fontSize: 15, fontSize: 15,
@ -256,10 +276,14 @@ class _FooterWidgetState extends State<FooterWidget> {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
} else { } else {
await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); await widget.addToShoppingCartFunction(
quantity: widget.quantity,
itemID: widget.item.id,
model: widget.model);
} }
}, },
textColor: isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white, textColor:
isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderRadius: 6, borderRadius: 6,
disableColor: Color(0xFFD6D6D6), disableColor: Color(0xFFD6D6D6),
@ -275,11 +299,15 @@ class _FooterWidgetState extends State<FooterWidget> {
} }
bool isBuyNowDisable() { bool isBuyNowDisable() {
return (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx; return (!widget.isAvailable && widget.quantity > 0) ||
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx;
} }
bool isAddToCartDisable() { bool isAddToCartDisable() {
return (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx; return (!widget.isAvailable && widget.quantity > 0) ||
widget.quantity > widget.quantityLimit ||
widget.item.isRx;
} }
void setUserValues(value) async { void setUserValues(value) async {
@ -294,7 +322,9 @@ class _FooterWidgetState extends State<FooterWidget> {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { authService
.selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class ReviewsInfo extends StatelessWidget { class ReviewsInfo extends StatelessWidget {
@ -13,6 +15,7 @@ class ReviewsInfo extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return previousModel.productDetailService.length != 0 && return previousModel.productDetailService.length != 0 &&
previousModel.productDetailService[0].reviews.length != 0 previousModel.productDetailService[0].reviews.length != 0
? ListView.builder( ? ListView.builder(
@ -48,7 +51,24 @@ class ReviewsInfo extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 210), // margin: EdgeInsets.only(left: 210),
child: projectViewModel.isArabic?
Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: previousModel
.productDetailService[0].reviews[index].rating
.toDouble(),
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
): Align(
alignment: Alignment.topRight,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: previousModel initialRating: previousModel
.productDetailService[0].reviews[index].rating .productDetailService[0].reviews[index].rating
@ -62,19 +82,23 @@ class ReviewsInfo extends StatelessWidget {
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
), ),
),
], ],
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text( child: Text(
previousModel previousModel
.productDetailService[0].reviews[index].reviewText, .productDetailService[0].reviews[index].reviewText,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
), ),
),
SizedBox( SizedBox(
height: 50, height: 50,
), ),

@ -59,7 +59,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
}, },
onSubmit: (value) { onSubmit: (value) {
searchMedicine(model, context); searchMedicine(model, context);
msg = TranslationBase.of(context).noResultFound; msg = TranslationBase.of(context).noSearchResultFound;
}, },
controller: textController, controller: textController,
// validator: (value) { // validator: (value) {

@ -706,7 +706,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} else { } else {
AppToast.showErrorToast(message: "Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration"); AppToast.showErrorToast(message: "Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration\فشلت العملية حاول مره اخرى");
} }
} }
} }

@ -6,6 +6,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'dart:io' show Platform;
class pharmacyContactsPage extends StatefulWidget { class pharmacyContactsPage extends StatefulWidget {
@override @override
@ -21,6 +23,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
final whatsApp = "+966558434444"; final whatsApp = "+966558434444";
final whatappURL_android = "whatsapp://send?phone=" + whatsApp; final whatappURL_android = "whatsapp://send?phone=" + whatsApp;
final whatappURL_ios = "https://wa.me/$whatsApp"; final whatappURL_ios = "https://wa.me/$whatsApp";
final locationDescription = "Main Pharmacy OLAYA";
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).contactUs, appBarTitle: TranslationBase.of(context).contactUs,
@ -30,6 +33,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
showPharmacyCart: false, showPharmacyCart: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
isBottomBar: true,
body: Column( body: Column(
children: [ children: [
Card( Card(
@ -55,8 +59,12 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Text("Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - -8:00 PM", child: Text(TranslationBase.of(context).contactUsTime,
style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
), ),
), ),
SizedBox( SizedBox(
@ -77,11 +85,21 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox( SizedBox(
width: 20, width: 20,
), ),
Text(TranslationBase.of(context).phone, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), Text(TranslationBase.of(context).phone,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Text("+966 " + " -11- 2833400", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), Text("+966 " + " -11- 2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
], ],
), ),
SizedBox( SizedBox(
@ -103,11 +121,21 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox( SizedBox(
width: 20, width: 20,
), ),
Text(TranslationBase.of(context).whatsApp, style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), Text(TranslationBase.of(context).whatsApp,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Text("+966 " + " 558434444", style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), Text("+966 " + " 558434444",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
], ],
), ),
SizedBox( SizedBox(
@ -119,8 +147,24 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () {
MapsLauncher.launchCoordinates(double.parse(latitude), double.parse(longitude)); if (Platform.isIOS) { MapLauncher.showMarker(
mapType: MapType.apple,
coords: Coords(double.parse(latitude),
double.parse(longitude)),
title: locationDescription,);
} else { MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(latitude),
double.parse(longitude)),
title: locationDescription,
// description: location.locationName,
); }
// MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
}, },
// MapsLauncher.launchCoordinates(
// double.parse(latitude),
// double.parse(longitude));
// },
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/pharmacy/location.svg', 'assets/images/pharmacy/location.svg',
width: 20, width: 20,
@ -131,8 +175,13 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
width: 20, width: 20,
), ),
Expanded( Expanded(
child: Text("P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", child: Text(
style: TextStyle(color: Colors.grey[700], fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.68)), TranslationBase.of(context).contactUsLocation,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
), ),
], ],
), ),
@ -141,35 +190,40 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
height: 50, height: 50,
), ),
Center( Center(
child: Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
IconButton( IconButton(
icon: new Image.asset('assets/images/new-design/facebook.png'), icon: new Image.asset(
'assets/images/new-design/facebook.png'),
tooltip: 'facebook', tooltip: 'facebook',
iconSize: 48, iconSize: 48,
onPressed: () { onPressed: () {
setState(() { setState(() {
launch("https://facebook.com/HMG"); launch("https://facebook.com/HMG.pharmacy");
// launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); // launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn");
}); });
}, },
), ),
IconButton( IconButton(
icon: new Image.asset('assets/images/new-design/twitter.png'), icon: new Image.asset(
'assets/images/new-design/twitter.png'),
tooltip: 'Twitter', tooltip: 'Twitter',
iconSize: 48, iconSize: 48,
onPressed: () { onPressed: () {
setState(() { setState(() {
launch("https://twitter.com/HMG"); launch("https://twitter.com/HMG_pharmacy");
}); });
}, },
), ),
IconButton( IconButton(
icon: new Image.asset('assets/images/pharmacy/instagram.png'), icon: new Image.asset(
'assets/images/pharmacy/instagram.png'),
tooltip: 'Instagram', tooltip: 'Instagram',
iconSize: 48, iconSize: 48,
onPressed: () { onPressed: () {
setState(() { setState(() {
launch("https://instagram.com/HMG"); launch("https://instagram.com/HMG_pharmacy");
}); });
}, },
), ),

@ -474,8 +474,8 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Text( Text( TranslationBase.of(context).termOfService,
TranslationBase.of(context).conditionsHMG, // TranslationBase.of(context).conditionsHMG,
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),

@ -71,7 +71,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
onSubmit: (value) { onSubmit: (value) {
searchMedicine(model, context); searchMedicine(model, context);
// msg = 'No Result Found'; // msg = 'No Result Found';
msg = TranslationBase.of(context).noResultFound; msg = TranslationBase.of(context).noSearchResultFound;
}, },
controller: textController, controller: textController,
), ),

@ -71,6 +71,8 @@ class TranslationBase {
String get noResultFound => localizedValues['noResultFound'][locale.languageCode]; String get noResultFound => localizedValues['noResultFound'][locale.languageCode];
String get noSearchResultFound => localizedValues['noSearchResultFound'][locale.languageCode];
String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode]; String get pleaseEnterProductName => localizedValues['pleaseEnterProductName'][locale.languageCode];
String get bookNow => localizedValues['bookNow'][locale.languageCode]; String get bookNow => localizedValues['bookNow'][locale.languageCode];
@ -591,6 +593,10 @@ class TranslationBase {
String get contactUs => localizedValues['ContactUs'][locale.languageCode]; String get contactUs => localizedValues['ContactUs'][locale.languageCode];
String get contactUsLocation => localizedValues['contactUsLocation'][locale.languageCode];
String get contactUsTime => localizedValues['contactUsTime'][locale.languageCode];
String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode]; String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode];
String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode];

Loading…
Cancel
Save