|
|
|
@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/address-select-page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
|
|
|
|
@ -22,7 +23,8 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
PreferredSizeWidget appBarWidget = AppBarWidget("Check out", null, true);
|
|
|
|
|
PreferredSizeWidget appBarWidget =
|
|
|
|
|
AppBarWidget("${TranslationBase.of(context).checkOut}", null, true);
|
|
|
|
|
final mediaQuery = MediaQuery.of(context);
|
|
|
|
|
final height = mediaQuery.size.height -
|
|
|
|
|
appBarWidget.preferredSize.height -
|
|
|
|
@ -33,7 +35,7 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
builder: (_, model, wi) => ChangeNotifierProvider.value(
|
|
|
|
|
value: model.paymentCheckoutData,
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
title: "Check out",
|
|
|
|
|
title: "${TranslationBase.of(context).checkOut}",
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
isShowDecPage: false,
|
|
|
|
|
appBarWidget: appBarWidget,
|
|
|
|
@ -114,13 +116,13 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Subtotal",
|
|
|
|
|
"${TranslationBase.of(context).subtotal}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -139,13 +141,13 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Shipping",
|
|
|
|
|
"${TranslationBase.of(context).shipping}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}",
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.totalAdditionalShippingCharge).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -164,13 +166,13 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"VAT (15%)",
|
|
|
|
|
"${TranslationBase.of(context).vat}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
@ -195,7 +197,7 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -215,7 +217,9 @@ class OrderPreviewPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
height: model.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
|
|
|
|
|
height: model.cartResponse.shoppingCarts != null
|
|
|
|
|
? height * 0.10
|
|
|
|
|
: 0,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: PaymentBottomWidget(model),
|
|
|
|
|
),
|
|
|
|
@ -396,7 +400,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
vertical: 0, horizontal: 6),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"SHIP BY:",
|
|
|
|
|
"${TranslationBase.of(context).shipBy}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Colors.black,
|
|
|
|
@ -562,6 +566,8 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
|
|
|
|
@ -579,7 +585,7 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Lakum Points",
|
|
|
|
|
"${TranslationBase.of(context).lakumPoints}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
@ -599,23 +605,27 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Riyal",
|
|
|
|
|
"${TranslationBase.of(context).riyal}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 4),
|
|
|
|
|
margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4),
|
|
|
|
|
width: 60,
|
|
|
|
|
height: 40,
|
|
|
|
|
height: 50,
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
|
borderSide:
|
|
|
|
|
BorderSide(color: Colors.black, width: 0.2),
|
|
|
|
|
gapPadding: 0,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(8),
|
|
|
|
|
bottomLeft: Radius.circular(8)),
|
|
|
|
|
borderRadius: projectProvider.isArabic
|
|
|
|
|
? BorderRadius.only(
|
|
|
|
|
topRight: Radius.circular(8),
|
|
|
|
|
bottomRight: Radius.circular(8))
|
|
|
|
|
: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(8),
|
|
|
|
|
bottomLeft: Radius.circular(8)),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide:
|
|
|
|
@ -670,12 +680,16 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: 40,
|
|
|
|
|
height: 50,
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: Color(0xff3666E0),
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
borderRadius: projectProvider.isArabic
|
|
|
|
|
? BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(6),
|
|
|
|
|
bottomLeft: Radius.circular(6))
|
|
|
|
|
: BorderRadius.only(
|
|
|
|
|
topRight: Radius.circular(6),
|
|
|
|
|
bottomRight: Radius.circular(6)),
|
|
|
|
|
border: Border.fromBorderSide(BorderSide(
|
|
|
|
@ -684,7 +698,7 @@ class _LakumWidgetState extends State<LakumWidget> {
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"USE",
|
|
|
|
|
"${TranslationBase.of(context).use}",
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -727,7 +741,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"SAR ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}",
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
@ -736,7 +750,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.symmetric(horizontal: 4),
|
|
|
|
|
child: Texts(
|
|
|
|
|
"(inclusive VAT)",
|
|
|
|
|
"${TranslationBase.of(context).inclusiveVat}",
|
|
|
|
|
fontSize: 8,
|
|
|
|
|
color: Color(0xff929295),
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
@ -746,7 +760,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
"${model.cartResponse.quantityCount} item(s)",
|
|
|
|
|
"${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -785,7 +799,7 @@ class PaymentBottomWidget extends StatelessWidget {
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16),
|
|
|
|
|
child: new Text(
|
|
|
|
|
"PROCEED TO PAY",
|
|
|
|
|
"${TranslationBase.of(context).proceedPay}",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
color: (paymentData.address != null &&
|
|
|
|
|
paymentData.paymentOption != null)
|
|
|
|
|