@@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
12
12
import 'package:label_storemax/app_payment_methods.dart' ;
13
13
import 'package:label_storemax/app_state_options.dart' ;
14
14
import 'package:label_storemax/helpers/tools.dart' ;
15
+ import 'package:label_storemax/labelconfig.dart' ;
15
16
import 'package:label_storemax/models/cart.dart' ;
16
17
import 'package:label_storemax/models/checkout_session.dart' ;
17
18
import 'package:label_storemax/models/customer_address.dart' ;
@@ -208,73 +209,78 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
208
209
),
209
210
margin: EdgeInsets .only (top: 5 , bottom: 5 ),
210
211
child: Column (
211
- crossAxisAlignment: CrossAxisAlignment .center,
212
- mainAxisAlignment: MainAxisAlignment .spaceAround,
213
- children: < Widget > [
214
- ((CheckoutSession .getInstance.billingDetails != null &&
215
- CheckoutSession .getInstance.billingDetails
216
- .billingAddress !=
217
- null )
218
- ? wsCheckoutRow (context,
219
- heading: trans (
220
- context, "Billing/shipping details" ),
221
- leadImage: Icon (Icons .home),
222
- leadTitle: ( CheckoutSession
223
- .getInstance.billingDetails ==
224
- null ||
225
- CheckoutSession .getInstance
226
- .billingDetails.billingAddress
227
- . hasMissingFields ()
228
- ? trans (
229
- context, "Billing address is incomplete" )
230
- : CheckoutSession .getInstance
231
- .billingDetails.billingAddress
232
- . addressFull ()) ,
233
- action : _actionCheckoutDetails,
234
- showBorderBottom : true )
235
- : wsCheckoutRow (context,
236
- heading : trans (context, "Billing/shipping details" ),
237
- leadImage: Icon (Icons .home),
238
- leadTitle: trans (context, "Add billing & shipping details" ),
239
- action: _actionCheckoutDetails,
240
- showBorderBottom: true )),
241
- (CheckoutSession .getInstance.paymentType != null
242
- ? wsCheckoutRow (context,
243
- heading: trans (context, "Payment method" ),
244
- leadImage: Image (
212
+ crossAxisAlignment: CrossAxisAlignment .center,
213
+ mainAxisAlignment: MainAxisAlignment .spaceAround,
214
+ children: < Widget > [
215
+ ((CheckoutSession .getInstance.billingDetails != null &&
216
+ CheckoutSession .getInstance.billingDetails
217
+ .billingAddress !=
218
+ null )
219
+ ? wsCheckoutRow (context,
220
+ heading: trans (
221
+ context, "Billing/shipping details" ),
222
+ leadImage: Icon (Icons .home),
223
+ leadTitle:
224
+ ( CheckoutSession .getInstance.billingDetails == null ||
225
+ CheckoutSession .getInstance
226
+ .billingDetails.billingAddress
227
+ . hasMissingFields ()
228
+ ? trans (
229
+ context, "Billing address is incomplete" )
230
+ : CheckoutSession .getInstance
231
+ .billingDetails.billingAddress
232
+ . addressFull ()),
233
+ action : _actionCheckoutDetails ,
234
+ showBorderBottom : true )
235
+ : wsCheckoutRow (context,
236
+ heading :
237
+ trans (context, "Billing/shipping details" ),
238
+ leadImage: Icon (Icons .home),
239
+ leadTitle: trans (context, "Add billing & shipping details" ),
240
+ action: _actionCheckoutDetails,
241
+ showBorderBottom: true )),
242
+ (CheckoutSession .getInstance.paymentType != null
243
+ ? wsCheckoutRow (context,
244
+ heading: trans (context, "Payment method" ),
245
+ leadImage: Image (
245
246
image: AssetImage ("assets/images/" +
246
247
CheckoutSession .getInstance
247
248
.paymentType.assetImage),
248
- width: 70 ),
249
- leadTitle: CheckoutSession
250
- .getInstance.paymentType.desc,
251
- action: _actionPayWith,
252
- showBorderBottom: true )
253
- : wsCheckoutRow (context,
254
- heading: trans (context, "Pay with" ),
255
- leadImage: Icon (Icons .payment),
256
- leadTitle:
257
- trans (context, "Select a payment method" ),
258
- action: _actionPayWith,
259
- showBorderBottom: true )),
260
- (CheckoutSession .getInstance.shippingType != null
261
- ? wsCheckoutRow (context,
262
- heading: trans (context, "Shipping selected" ),
263
- leadImage: Icon (Icons .local_shipping),
264
- leadTitle: CheckoutSession
265
- .getInstance.shippingType
266
- .getTitle (),
267
- action: _actionSelectShipping)
268
- : wsCheckoutRow (
269
- context,
270
- heading: trans (context, "Select shipping" ),
271
- leadImage: Icon (Icons .local_shipping),
272
- leadTitle: trans (
273
- context, "Select a shipping option" ),
274
- action: _actionSelectShipping,
275
- )),
276
- ],
277
- ),
249
+ width: 70 ,
250
+ ),
251
+ leadTitle: CheckoutSession
252
+ .getInstance.paymentType.desc,
253
+ action: _actionPayWith,
254
+ showBorderBottom: true )
255
+ : wsCheckoutRow (context,
256
+ heading: trans (context, "Pay with" ),
257
+ leadImage: Icon (Icons .payment),
258
+ leadTitle: trans (
259
+ context, "Select a payment method" ),
260
+ action: _actionPayWith,
261
+ showBorderBottom: true )),
262
+ app_disable_shipping == true
263
+ ? null
264
+ : (CheckoutSession .getInstance.shippingType !=
265
+ null
266
+ ? wsCheckoutRow (context,
267
+ heading:
268
+ trans (context, "Shipping selected" ),
269
+ leadImage: Icon (Icons .local_shipping),
270
+ leadTitle: CheckoutSession
271
+ .getInstance.shippingType
272
+ .getTitle (),
273
+ action: _actionSelectShipping)
274
+ : wsCheckoutRow (
275
+ context,
276
+ heading:
277
+ trans (context, "Select shipping" ),
278
+ leadImage: Icon (Icons .local_shipping),
279
+ leadTitle: trans (context,
280
+ "Select a shipping option" ),
281
+ action: _actionSelectShipping,
282
+ )),
283
+ ].where ((e) => e != null ).toList ()),
278
284
),
279
285
),
280
286
Column (
@@ -286,14 +292,18 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
286
292
thickness: 1 ,
287
293
),
288
294
wsCheckoutSubtotalWidgetFB (
289
- title: trans (context, "Subtotal" )),
290
- widgetCheckoutMeta (context,
291
- title: trans (context, "Shipping fee" ),
292
- amount:
293
- CheckoutSession .getInstance.shippingType == null
294
- ? trans (context, "Select shipping" )
295
- : CheckoutSession .getInstance.shippingType
296
- .getTotal (withFormatting: true )),
295
+ title: trans (context, "Subtotal" ),
296
+ ),
297
+ app_disable_shipping == true
298
+ ? null
299
+ : widgetCheckoutMeta (context,
300
+ title: trans (context, "Shipping fee" ),
301
+ amount:
302
+ CheckoutSession .getInstance.shippingType ==
303
+ null
304
+ ? trans (context, "Select shipping" )
305
+ : CheckoutSession .getInstance.shippingType
306
+ .getTotal (withFormatting: true )),
297
307
(_taxRate != null
298
308
? wsCheckoutTaxAmountWidgetFB (taxRate: _taxRate)
299
309
: null ),
@@ -322,7 +332,7 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
322
332
Padding (
323
333
padding: const EdgeInsets .only (top: 15 ),
324
334
child: Text (
325
- trans (context, "One moment" ) + " ..." ,
335
+ "${ trans (context , "One moment" )} ..." ,
326
336
style: Theme .of (context).primaryTextTheme.subtitle1,
327
337
),
328
338
)
@@ -358,7 +368,8 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
358
368
return ;
359
369
}
360
370
361
- if (CheckoutSession .getInstance.shippingType == null ) {
371
+ if (app_disable_shipping == false &&
372
+ CheckoutSession .getInstance.shippingType == null ) {
362
373
showEdgeAlertWith (
363
374
context,
364
375
title: trans (context, "Oops" ),
@@ -380,7 +391,8 @@ class CheckoutConfirmationPageState extends State<CheckoutConfirmationPage> {
380
391
return ;
381
392
}
382
393
383
- if (CheckoutSession .getInstance.shippingType.minimumValue != null ) {
394
+ if (app_disable_shipping == false &&
395
+ CheckoutSession .getInstance.shippingType.minimumValue != null ) {
384
396
String total = await Cart .getInstance.getTotal ();
385
397
if (total == null ) {
386
398
return ;
0 commit comments