|
|
|
@ -31,33 +31,47 @@ class OrderPreviewPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
MyInAppBrowser browser;
|
|
|
|
MyInAppBrowser browser;
|
|
|
|
|
|
|
|
bool isLoading = true;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
Provider.of<OrderPreviewViewModel>(context, listen: false).getShoppingCart();
|
|
|
|
getData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void getData() async {
|
|
|
|
|
|
|
|
if (isLoading)
|
|
|
|
|
|
|
|
await Provider.of<OrderPreviewViewModel>(context, listen: false)
|
|
|
|
|
|
|
|
.getShoppingCart();
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
isLoading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
|
|
final mediaQuery = MediaQuery.of(context);
|
|
|
|
final mediaQuery = MediaQuery.of(context);
|
|
|
|
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
|
|
|
|
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
|
|
|
|
OrderPreviewViewModel model = Provider.of(context);
|
|
|
|
OrderPreviewViewModel model = Provider.of(context);
|
|
|
|
return NetworkBaseView(
|
|
|
|
return AppScaffold(
|
|
|
|
child: AppScaffold(
|
|
|
|
|
|
|
|
appBarTitle: "${TranslationBase.of(context).checkOut}",
|
|
|
|
appBarTitle: "${TranslationBase.of(context).checkOut}",
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isPharmacy: true,
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
|
|
|
isLoading: isLoading,
|
|
|
|
|
|
|
|
isLocalLoader: true,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
baseViewModel: model,
|
|
|
|
// baseViewModel: model,
|
|
|
|
body: Container(
|
|
|
|
body: Container(
|
|
|
|
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
height: height * 0.90,
|
|
|
|
height: height * 0.90,
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SelectAddressWidget(model,widget.addresses),
|
|
|
|
SelectAddressWidget(model, widget.addresses),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -87,9 +101,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).reviewOrder,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.reviewOrder,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
@ -98,10 +110,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
model.cartResponse.shoppingCarts != null
|
|
|
|
model.cartResponse.shoppingCarts != null
|
|
|
|
? model.cartResponse.shoppingCarts.length
|
|
|
|
? model.cartResponse.shoppingCarts.length
|
|
|
|
: 0,
|
|
|
|
: 0,
|
|
|
|
(index) =>
|
|
|
|
(index) => ProductOrderPreviewItem(
|
|
|
|
ProductOrderPreviewItem(
|
|
|
|
model.cartResponse.shoppingCarts[index]),
|
|
|
|
model.cartResponse
|
|
|
|
|
|
|
|
.shoppingCarts[index]),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -111,13 +121,10 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
child: model.cartResponse.subtotal != null
|
|
|
|
child: model.cartResponse.subtotal != null
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).orderSummary,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.orderSummary,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
@ -126,22 +133,16 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).subtotal}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.subtotal}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.sar} ${(model.cartResponse.subtotal)
|
|
|
|
|
|
|
|
.toStringAsFixed(2)}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -156,23 +157,16 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).shipping}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.shipping}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.sar} ${(model
|
|
|
|
|
|
|
|
.totalAdditionalShippingCharge)
|
|
|
|
|
|
|
|
.toStringAsFixed(2)}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -187,23 +181,16 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).vat}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.vat}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.sar} ${(model.cartResponse
|
|
|
|
|
|
|
|
.subtotalVatAmount).toStringAsFixed(
|
|
|
|
|
|
|
|
2)}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -218,22 +205,16 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).total,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.total,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.sar} ${(model.cartResponse.subtotal)
|
|
|
|
|
|
|
|
.toStringAsFixed(2)}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -253,14 +234,10 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: Container(
|
|
|
|
bottomSheet: Container(
|
|
|
|
height: model.cartResponse.shoppingCarts != null
|
|
|
|
height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
|
|
|
|
? height * 0.10
|
|
|
|
|
|
|
|
: 0,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: PaymentBottomWidget(model),
|
|
|
|
child: PaymentBottomWidget(model),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -308,8 +285,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Consumer<PaymentCheckoutData>(
|
|
|
|
return Consumer<PaymentCheckoutData>(
|
|
|
|
builder: (ctx, paymentData, _) =>
|
|
|
|
builder: (ctx, paymentData, _) => Container(
|
|
|
|
Container(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: address == null
|
|
|
|
child: address == null
|
|
|
|
? InkWell(
|
|
|
|
? InkWell(
|
|
|
|
@ -329,9 +305,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).selectAddress,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.selectAddress,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
@ -366,9 +340,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).shippingAddress,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.shippingAddress,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
@ -378,9 +350,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () => {_navigateToAddressPage()},
|
|
|
|
onTap: () => {_navigateToAddressPage()},
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).changeAddress,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.changeAddress,
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
@ -400,9 +370,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
"${address.address1} ${address.address2} ${address
|
|
|
|
"${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}",
|
|
|
|
.address2},, ${address.city}, ${address
|
|
|
|
|
|
|
|
.country} ${address.zipPostalCode}",
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
color: Colors.grey.shade500,
|
|
|
|
color: Colors.grey.shade500,
|
|
|
|
@ -448,9 +416,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).shipBy}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.shipBy}",
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
@ -493,8 +459,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
|
|
|
|
|
|
|
|
|
|
|
|
_navigateToPaymentOption() {
|
|
|
|
_navigateToPaymentOption() {
|
|
|
|
Navigator.push(context, FadePage(page: PaymentMethodSelectPage()))
|
|
|
|
Navigator.push(context, FadePage(page: PaymentMethodSelectPage()))
|
|
|
|
.then((result) =>
|
|
|
|
.then((result) => {
|
|
|
|
{
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
if (result != null) {
|
|
|
|
if (result != null) {
|
|
|
|
paymentOption = result;
|
|
|
|
paymentOption = result;
|
|
|
|
@ -536,9 +501,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
|
|
|
|
EdgeInsets.symmetric(vertical: 0, horizontal: 6),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).selectPaymentOption,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.selectPaymentOption,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
@ -592,9 +555,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () => {_navigateToPaymentOption()},
|
|
|
|
onTap: () => {_navigateToPaymentOption()},
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
TranslationBase
|
|
|
|
TranslationBase.of(context).changeMethod,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.changeMethod,
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
color: Color(0xff0000ff),
|
|
|
|
@ -640,15 +601,12 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).lakumPoints}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.lakumPoints}",
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${widget.model.paymentCheckoutData.lacumInformation
|
|
|
|
"${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
|
|
|
|
.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -663,9 +621,7 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).riyal}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.riyal}",
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -760,9 +716,7 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).use}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.use}",
|
|
|
|
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -794,8 +748,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
|
|
|
child: Consumer<PaymentCheckoutData>(
|
|
|
|
child: Consumer<PaymentCheckoutData>(
|
|
|
|
builder: (ctx, paymentData, _) =>
|
|
|
|
builder: (ctx, paymentData, _) => paymentData.cartDataVisible
|
|
|
|
paymentData.cartDataVisible
|
|
|
|
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
@ -810,10 +763,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.sar} ${(model.cartResponse.subtotal)
|
|
|
|
|
|
|
|
.toStringAsFixed(2)}",
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Color(0xff929295),
|
|
|
|
color: Color(0xff929295),
|
|
|
|
@ -822,9 +772,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
child: Texts(
|
|
|
|
child: Texts(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).inclusiveVat}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.inclusiveVat}",
|
|
|
|
|
|
|
|
fontSize: 8,
|
|
|
|
fontSize: 8,
|
|
|
|
color: Color(0xff929295),
|
|
|
|
color: Color(0xff929295),
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
@ -834,9 +782,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${model.cartResponse.quantityCount} ${TranslationBase
|
|
|
|
"${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.items}",
|
|
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
color: Colors.grey,
|
|
|
|
color: Colors.grey,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -858,8 +804,10 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
await model.makeOrder();
|
|
|
|
await model.makeOrder();
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
if (model.state == ViewState.Idle) {
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
message: "Order has been placed successfully!!");
|
|
|
|
message:
|
|
|
|
openPayment(model.orderListModel[0], model.user);
|
|
|
|
"Order has been placed successfully!!");
|
|
|
|
|
|
|
|
openPayment(
|
|
|
|
|
|
|
|
model.orderListModel[0], model.user);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(message: model.error);
|
|
|
|
AppToast.showErrorToast(message: model.error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -870,9 +818,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
child: new Text(
|
|
|
|
child: new Text(
|
|
|
|
"${TranslationBase
|
|
|
|
"${TranslationBase.of(context).proceedPay}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.proceedPay}",
|
|
|
|
|
|
|
|
style: new TextStyle(
|
|
|
|
style: new TextStyle(
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
@ -900,8 +846,10 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
openPayment(OrderDetailModel order,
|
|
|
|
openPayment(
|
|
|
|
AuthenticatedUser authenticatedUser,) {
|
|
|
|
OrderDetailModel order,
|
|
|
|
|
|
|
|
AuthenticatedUser authenticatedUser,
|
|
|
|
|
|
|
|
) {
|
|
|
|
browser = new MyInAppBrowser(
|
|
|
|
browser = new MyInAppBrowser(
|
|
|
|
onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart);
|
|
|
|
onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart);
|
|
|
|
|
|
|
|
|
|
|
|
@ -912,8 +860,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
order.id,
|
|
|
|
order.id,
|
|
|
|
order.billingAddress.email,
|
|
|
|
order.billingAddress.email,
|
|
|
|
order.customValuesXml,
|
|
|
|
order.customValuesXml,
|
|
|
|
"${authenticatedUser.firstName} ${authenticatedUser
|
|
|
|
"${authenticatedUser.firstName} ${authenticatedUser.middleName} ${authenticatedUser.lastName}",
|
|
|
|
.middleName} ${authenticatedUser.lastName}",
|
|
|
|
|
|
|
|
authenticatedUser.patientID,
|
|
|
|
authenticatedUser.patientID,
|
|
|
|
authenticatedUser,
|
|
|
|
authenticatedUser,
|
|
|
|
browser);
|
|
|
|
browser);
|
|
|
|
|