|
|
|
|
@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
@ -79,20 +80,18 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Consumer<PaymentCheckoutData>(
|
|
|
|
|
builder: (ctx, paymentData, _) =>
|
|
|
|
|
paymentData.lacumInformation != null
|
|
|
|
|
? Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
LakumWidget(model),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container()),
|
|
|
|
|
model.paymentCheckoutData.lacumInformation != null
|
|
|
|
|
? Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
LakumWidget(model),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
@ -227,7 +226,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -284,162 +284,161 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Consumer<PaymentCheckoutData>(
|
|
|
|
|
builder: (ctx, paymentData, _) => Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: address == null
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () => {_navigateToAddressPage()},
|
|
|
|
|
OrderPreviewViewModel model = Provider.of(context);
|
|
|
|
|
return Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: address == null
|
|
|
|
|
? InkWell(
|
|
|
|
|
onTap: () => {_navigateToAddressPage()},
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/ic_shipping_address.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/ic_shipping_address.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).selectAddress,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 20,
|
|
|
|
|
color: Colors.grey.shade400,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).selectAddress,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/ic_shipping_mark.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).shippingAddress,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () => {_navigateToAddressPage()},
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).changeAddress,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${address.firstName} ${address.lastName}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: Colors.grey.shade500,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: const EdgeInsets.only(right: 8),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.phone,
|
|
|
|
|
size: 20,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${address.phoneNumber}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 2,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Color(0xffefefef),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/ic_shipping_truck.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).shipBy}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
paymentData.shippingOption
|
|
|
|
|
.shippingRateComputationMethodSystemName ==
|
|
|
|
|
"Shipping.FixedOrByWeight"
|
|
|
|
|
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png"
|
|
|
|
|
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 20,
|
|
|
|
|
color: Colors.grey.shade400,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/ic_shipping_mark.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).shippingAddress,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () => {_navigateToAddressPage()},
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).changeAddress,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${address.firstName} ${address.lastName}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
), // ic_shipping_mark.png
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
color: Colors.grey.shade500,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: const EdgeInsets.only(right: 8),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.phone,
|
|
|
|
|
size: 20,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${address.phoneNumber}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 2,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Color(0xffefefef),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/ic_shipping_truck.png",
|
|
|
|
|
width: 30.0,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).shipBy}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
model.paymentCheckoutData.shippingOption==null?"": model.paymentCheckoutData.shippingOption
|
|
|
|
|
.shippingRateComputationMethodSystemName ==
|
|
|
|
|
"Shipping.FixedOrByWeight"
|
|
|
|
|
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png"
|
|
|
|
|
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
),
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
), // ic_shipping_mark.png
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -465,7 +464,6 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
|
|
|
|
|
paymentOption = result;
|
|
|
|
|
widget.model.paymentCheckoutData.paymentOption =
|
|
|
|
|
paymentOption;
|
|
|
|
|
widget.model.paymentCheckoutData.updateData();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
@ -744,105 +742,103 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final scaffold = Scaffold.of(context);
|
|
|
|
|
this.context = context;
|
|
|
|
|
|
|
|
|
|
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
|
|
|
|
child: Consumer<PaymentCheckoutData>(
|
|
|
|
|
builder: (ctx, paymentData, _) => paymentData.cartDataVisible
|
|
|
|
|
? Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 0, vertical: 4),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).inclusiveVat}",
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
width: 1,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onPressed: (paymentData.address != null &&
|
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
|
? () async {
|
|
|
|
|
await model.makeOrder();
|
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
|
message:
|
|
|
|
|
"Order has been placed successfully!!");
|
|
|
|
|
openPayment(
|
|
|
|
|
model.orderListModel[0], model.user);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: model.error);
|
|
|
|
|
}
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
|
child: new Text(
|
|
|
|
|
"${TranslationBase.of(context).proceedPay}",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors.grey.shade400,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 12),
|
|
|
|
|
),
|
|
|
|
|
child: orderPreviewViewModel.paymentCheckoutData.cartDataVisible
|
|
|
|
|
? Container(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 0, vertical: 4),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"${TranslationBase.of(context).inclusiveVat}",
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Color(0xff929295),
|
|
|
|
|
disabledColor: (paymentData.address != null &&
|
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Color(0xff929295),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: RaisedButton(
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
side: BorderSide(
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
width: 1,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
|
? () async {
|
|
|
|
|
await model.makeOrder();
|
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
|
message:
|
|
|
|
|
"Order has been placed successfully!!");
|
|
|
|
|
openPayment(
|
|
|
|
|
model.orderListModel[0], model.user);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: model.error);
|
|
|
|
|
}
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
|
child: new Text(
|
|
|
|
|
"${TranslationBase.of(context).proceedPay}",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
color: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors.grey.shade400,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontSize: 12),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
color: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Color(0xff929295),
|
|
|
|
|
disabledColor: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
|
? Colors.green
|
|
|
|
|
: Color(0xff929295),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|