|
|
|
@ -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/order_detail.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.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/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/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
@ -79,9 +80,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Consumer<PaymentCheckoutData>(
|
|
|
|
model.paymentCheckoutData.lacumInformation != null
|
|
|
|
builder: (ctx, paymentData, _) =>
|
|
|
|
|
|
|
|
paymentData.lacumInformation != null
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -92,7 +91,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container()),
|
|
|
|
: Container(),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
@ -227,7 +226,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
: Container(),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -284,8 +284,8 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Consumer<PaymentCheckoutData>(
|
|
|
|
OrderPreviewViewModel model = Provider.of(context);
|
|
|
|
builder: (ctx, paymentData, _) => Container(
|
|
|
|
return Container(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: address == null
|
|
|
|
child: address == null
|
|
|
|
? InkWell(
|
|
|
|
? InkWell(
|
|
|
|
@ -424,7 +424,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Image.asset(
|
|
|
|
child: Image.asset(
|
|
|
|
paymentData.shippingOption
|
|
|
|
model.paymentCheckoutData.shippingOption==null?"": model.paymentCheckoutData.shippingOption
|
|
|
|
.shippingRateComputationMethodSystemName ==
|
|
|
|
.shippingRateComputationMethodSystemName ==
|
|
|
|
"Shipping.FixedOrByWeight"
|
|
|
|
"Shipping.FixedOrByWeight"
|
|
|
|
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png"
|
|
|
|
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png"
|
|
|
|
@ -439,7 +439,6 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
), // ic_shipping_mark.png
|
|
|
|
), // ic_shipping_mark.png
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -465,7 +464,6 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
|
|
|
|
paymentOption = result;
|
|
|
|
paymentOption = result;
|
|
|
|
widget.model.paymentCheckoutData.paymentOption =
|
|
|
|
widget.model.paymentCheckoutData.paymentOption =
|
|
|
|
paymentOption;
|
|
|
|
paymentOption;
|
|
|
|
widget.model.paymentCheckoutData.updateData();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -744,11 +742,10 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final scaffold = Scaffold.of(context);
|
|
|
|
final scaffold = Scaffold.of(context);
|
|
|
|
this.context = context;
|
|
|
|
this.context = context;
|
|
|
|
|
|
|
|
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
|
|
|
child: Consumer<PaymentCheckoutData>(
|
|
|
|
child: orderPreviewViewModel.paymentCheckoutData.cartDataVisible
|
|
|
|
builder: (ctx, paymentData, _) => paymentData.cartDataVisible
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
@ -798,8 +795,8 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
width: 1,
|
|
|
|
width: 1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onPressed: (paymentData.address != null &&
|
|
|
|
onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
? () async {
|
|
|
|
? () async {
|
|
|
|
await model.makeOrder();
|
|
|
|
await model.makeOrder();
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
@ -820,20 +817,20 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
child: new Text(
|
|
|
|
child: new Text(
|
|
|
|
"${TranslationBase.of(context).proceedPay}",
|
|
|
|
"${TranslationBase.of(context).proceedPay}",
|
|
|
|
style: new TextStyle(
|
|
|
|
style: new TextStyle(
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
color: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
? Colors.white
|
|
|
|
? Colors.white
|
|
|
|
: Colors.grey.shade400,
|
|
|
|
: Colors.grey.shade400,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: 12),
|
|
|
|
fontSize: 12),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
color: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
? Colors.green
|
|
|
|
? Colors.green
|
|
|
|
: Color(0xff929295),
|
|
|
|
: Color(0xff929295),
|
|
|
|
disabledColor: (paymentData.address != null &&
|
|
|
|
disabledColor: (orderPreviewViewModel.paymentCheckoutData.address != null &&
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
|
|
|
|
? Colors.green
|
|
|
|
? Colors.green
|
|
|
|
: Color(0xff929295),
|
|
|
|
: Color(0xff929295),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -842,7 +839,6 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
: Container(),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|