fix lakum issues

merge-requests/564/head
Fatimah Alshammari 4 years ago
parent 10b96979a3
commit de86cffb8c

@ -277,6 +277,8 @@ const Map localizedValues = {
"viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"view": {"en": "View", 'ar': 'عرض'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
"contactUsLocation": {"en": "P.O.Box: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", 'ar': 'صندوق بريد: 91877 - الرياض 11643 ، طريق الملك فهد - العليا - المملكة العربية السعودية'},
"contactUsTime": {"en": "Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - 8:00 PM", 'ar': " السبت الأربعاء 08:00 ص 10:00 م , الخميس 08:00 ص 08:00 م, الجمعة 02:00 م - 08:00 م"},
"ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"},

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

@ -1,5 +1,8 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-preview.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -9,6 +12,7 @@ import 'package:provider/provider.dart';
class LakumWidget extends StatefulWidget {
final OrderPreviewViewModel model;
LakumWidget(this.model);
@override
@ -41,6 +45,15 @@ class _LakumWidgetState extends State<LakumWidget> {
setState(() {
useLakumWidgets = value;
print(useLakumWidgets);
// if (value){
// // isChecked;
// OrderPreviewPage.isChecked = true;
// print(value);
// }else{
// OrderPreviewPage.isChecked = false;
// }
setState(() {
});
});
},
),
@ -150,6 +163,25 @@ class _LakumWidgetState extends State<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 {
final OrderPreviewViewModel model;
static bool isChecked = true;
BuildContext context;
MyInAppBrowser browser;
@ -42,6 +43,12 @@ class PaymentBottomWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 4),
child: Row(
children: [
isChecked ? Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount - model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xff929295),
):
Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14,

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

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

@ -227,7 +227,7 @@ class _FooterWidgetState extends State<FooterWidget> {
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 5.0),
margin: EdgeInsets.symmetric( vertical: 4.0),
child: SecondaryButton(
label: TranslationBase.of(context).addToCart,
@ -254,7 +254,8 @@ class _FooterWidgetState extends State<FooterWidget> {
),
Container(
width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric( vertical: 5.0),
margin: EdgeInsets.symmetric( vertical: 4.0),
child: SecondaryButton(
label: TranslationBase.of(context).buyNow,

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

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

@ -39,6 +39,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
showPharmacyCart: false,
showHomeAppBarIcon: false,
isMainPharmacyPages: true,
isBottomBar: true,
body:Column(
children: [
Card(
@ -64,7 +65,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text("Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - -8:00 PM",
child: Text(TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
@ -179,7 +180,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
),
Expanded(
child: Text(
"P.O.BOX: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia",
TranslationBase.of(context).contactUsLocation,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
@ -245,7 +246,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
openWhatsApp() async{
// bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS;
var whatsapp ="+699558434444";
var whatsapp ="+966558434444";
var whatsappURL_android = "whatsapp://send?phone="+whatsapp;
var whatappURL_ios ="https://wa.me/$whatsapp";
if(Platform.isIOS){

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

Loading…
Cancel
Save