|
|
|
|
@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
@ -22,11 +23,7 @@ import 'package:provider/provider.dart';
|
|
|
|
|
import 'cart-page/cart-order-preview.dart';
|
|
|
|
|
|
|
|
|
|
class CartOrderPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CartOrderPage({ Key key})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
const CartOrderPage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_CartOrderPageState createState() => _CartOrderPageState();
|
|
|
|
|
@ -39,7 +36,6 @@ class _CartOrderPageState extends State<CartOrderPage> {
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
|
getData();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -206,12 +202,13 @@ class _CartOrderPageState extends State<CartOrderPage> {
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/pharmacy_module/payment.png",
|
|
|
|
|
width: mediaQuery.size.width - 20,
|
|
|
|
|
height: 30.0,
|
|
|
|
|
fit: BoxFit.scaleDown,
|
|
|
|
|
),
|
|
|
|
|
getPaymentMethods(),
|
|
|
|
|
// Image.asset(
|
|
|
|
|
// "assets/images/pharmacy_module/payment.png",
|
|
|
|
|
// width: mediaQuery.size.width - 20,
|
|
|
|
|
// height: 30.0,
|
|
|
|
|
// fit: BoxFit.scaleDown,
|
|
|
|
|
// ),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 120,
|
|
|
|
|
)
|
|
|
|
|
@ -402,27 +399,32 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
|
|
|
|
|
onPressed: isAgree
|
|
|
|
|
// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0
|
|
|
|
|
? () => {
|
|
|
|
|
if(cart.isCartItemsOutOfStock()){
|
|
|
|
|
// Toast msg
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)
|
|
|
|
|
}else {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page:
|
|
|
|
|
OrderPreviewPage(widget.addresses)))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (cart.isCartItemsOutOfStock())
|
|
|
|
|
{
|
|
|
|
|
// Toast msg
|
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
|
message: TranslationBase.of(context)
|
|
|
|
|
.outOfStockMsg)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: OrderPreviewPage(
|
|
|
|
|
widget.addresses)))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: new Text(
|
|
|
|
|
"${TranslationBase.of(context).checkOut}",
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
isAgree ? Colors.white : Colors.grey.shade300,
|
|
|
|
|
isAgree ? Colors.white : Colors.grey.shade300,
|
|
|
|
|
fontSize: 14),
|
|
|
|
|
),
|
|
|
|
|
color: Color(0xFF4CAF50),
|
|
|
|
|
disabledColor:Color(0xFF4CAF50),
|
|
|
|
|
disabledColor: Color(0xFF4CAF50),
|
|
|
|
|
// disabledColor: Color(0xff005aff),
|
|
|
|
|
)
|
|
|
|
|
// RaisedButton(
|
|
|
|
|
|