|
|
|
@ -15,8 +15,9 @@ import 'lakum_widget.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class OrderPreviewPage extends StatefulWidget {
|
|
|
|
class OrderPreviewPage extends StatefulWidget {
|
|
|
|
final List<Addresses> addresses;
|
|
|
|
final List<Addresses> addresses;
|
|
|
|
|
|
|
|
final OrderPreviewViewModel model;
|
|
|
|
|
|
|
|
|
|
|
|
OrderPreviewPage(this.addresses);
|
|
|
|
OrderPreviewPage({this.addresses, this.model});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_OrderPreviewPageState createState() => _OrderPreviewPageState();
|
|
|
|
_OrderPreviewPageState createState() => _OrderPreviewPageState();
|
|
|
|
@ -43,7 +44,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
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 widget.model = Provider.of(context);
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
appBarTitle: "${TranslationBase.of(context).checkOut}",
|
|
|
|
appBarTitle: "${TranslationBase.of(context).checkOut}",
|
|
|
|
isShowAppBar: true,
|
|
|
|
isShowAppBar: true,
|
|
|
|
@ -52,7 +53,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
isLoading: isLoading,
|
|
|
|
isLoading: isLoading,
|
|
|
|
isLocalLoader: true,
|
|
|
|
isLocalLoader: true,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
// baseViewModel: model,
|
|
|
|
// baseViewModel: widget.model,
|
|
|
|
body: Container(
|
|
|
|
body: Container(
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
height: height * 0.90,
|
|
|
|
height: height * 0.90,
|
|
|
|
@ -61,19 +62,19 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
color: Color(0xFFF1F1F1),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SelectAddressWidget(model, widget.addresses, changeMainState),
|
|
|
|
SelectAddressWidget(widget.model, widget.addresses, changeMainState),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SelectPaymentOptionWidget(model, changeMainState),
|
|
|
|
SelectPaymentOptionWidget(widget.model, changeMainState),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
model.paymentCheckoutData.lacumInformation != null
|
|
|
|
widget.model.paymentCheckoutData.lacumInformation != null
|
|
|
|
? Container(
|
|
|
|
? Container(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LakumWidget(model),
|
|
|
|
LakumWidget(widget.model),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10,
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -95,8 +96,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
...List.generate(
|
|
|
|
...List.generate(
|
|
|
|
model.cartResponse.shoppingCarts != null ? model.cartResponse.shoppingCarts.length : 0,
|
|
|
|
widget.model.cartResponse.shoppingCarts != null ? widget.model.cartResponse.shoppingCarts.length : 0,
|
|
|
|
(index) => ProductOrderPreviewItem(model.cartResponse.shoppingCarts[index]),
|
|
|
|
(index) => ProductOrderPreviewItem(widget.model.cartResponse.shoppingCarts[index]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -104,7 +105,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
child: model.cartResponse.subtotal != null
|
|
|
|
child: widget.model.cartResponse.subtotal != null
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -127,7 +128,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -151,7 +152,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}",
|
|
|
|
"${TranslationBase.of(context).sar} ${(widget.model.totalAdditionalShippingCharge).toStringAsFixed(2)}",
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -175,7 +176,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -199,7 +200,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Texts(
|
|
|
|
Texts(
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
color: Colors.black,
|
|
|
|
color: Colors.black,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -214,7 +215,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
: Container(),
|
|
|
|
: Container(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
|
|
|
|
height: widget.model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -222,9 +223,9 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: Container(
|
|
|
|
bottomSheet: Container(
|
|
|
|
height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
|
|
|
|
height: widget.model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
child: PaymentBottomWidget(model),
|
|
|
|
child: PaymentBottomWidget(widget.model),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|