change model

merge-update-with-lab-changes
Elham Rababh 4 years ago
parent 41097f119c
commit b7dc6ee4b1

@ -281,10 +281,9 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
OrderPreviewViewModel model = Provider.of(context);
return !(model.cartResponse.shoppingCarts == null || return !(widget.model.cartResponse.shoppingCarts == null ||
model.cartResponse.shoppingCarts.length == 0) widget.model.cartResponse.shoppingCarts.length == 0)
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -374,7 +373,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
child: Row( child: Row(
children: [ children: [
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalWithVat).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalWithVat).toStringAsFixed(2)}",
fontSize: projectProvider.isArabic ? 12 : 14, fontSize: projectProvider.isArabic ? 12 : 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -392,7 +391,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
), ),
), ),
Texts( Texts(
"${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}", "${widget.model.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -404,7 +403,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
onPressed: isAgree onPressed: isAgree
// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0 // && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0
? () => { ? () => {
if (model if (widget.model
.isCartItemsOutOfStock()) .isCartItemsOutOfStock())
{ {
// Toast msg // Toast msg
@ -414,7 +413,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
} }
else else
{ {
_navigateToAddressPage(model _navigateToAddressPage(widget.model
.user.patientIdentificationNo) .user.patientIdentificationNo)
// Navigator.push( // Navigator.push(
// context, // context,

Loading…
Cancel
Save