diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart index 44eb3e09..5d7f10e0 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart @@ -41,10 +41,9 @@ class _CartOrderPageState extends State { final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; AppScaffold appScaffold; return NetworkBaseView( - // baseViewModel: model, isLoading: isLoading, isLocalLoader: true, - child: AppScaffold( + child: appScaffold = AppScaffold( appBarTitle: TranslationBase.of(context).shoppingCart, isShowAppBar: true, isPharmacy: true, diff --git a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart index b9612925..6dc571d6 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart @@ -25,19 +25,9 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { final bool isInWishList; final Function addToCartFunction; + ProductAppBar({Key key, this.product, this.model, this.addToWishlistFunction, this.quantity, this.deleteFromWishlistFunction, this.isInWishList, this.addToCartFunction}) : super(key: key); - ProductAppBar( - {Key key, - this.product, - this.model, - this.addToWishlistFunction, - this.quantity, - this.deleteFromWishlistFunction, - this.isInWishList, this.addToCartFunction}) - : super(key: key); - - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); @override Widget build(BuildContext context) { @@ -75,25 +65,29 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { onPress: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), + MaterialPageRoute(builder: (context) => CartOrderPage()), ); }), - - if(Provider.of(context, listen: false).cartResponse.quantityCount !=0) - Positioned( - top:0, right: -1.0, - child: Container( - decoration: BoxDecoration( - color: Colors.red[800], - borderRadius: BorderRadius.circular(15), - + if (Provider.of(context, listen: false).cartResponse.quantityCount != 0) + Positioned( + top: 0, + right: -1.0, + child: Container( + decoration: BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(15), + ), + padding: EdgeInsets.only(left: 5, right: 4.5), + height: 18, + child: Center( + child: Texts( + Provider.of(context, listen: false).cartResponse.quantityCount.toString(), + style: "caption", + medium: true, + color: Colors.white, + )), ), - padding: EdgeInsets.only(left: 5, right: 4.5), - height: 18, - child: Center(child: Texts(Provider.of(context, listen: false).cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)), - ), - ) + ) ], ), SizedBox( @@ -135,16 +129,12 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { onTap: () async { if (quantity > 0) { { - await addToCartFunction( - quantity: quantity, - itemID: itemID, - model: model); + await addToCartFunction(quantity: quantity, itemID: itemID, model: model); Navigator.of(context).pop(); } } else { - AppToast.showErrorToast( - message: "you should add quantity"); + AppToast.showErrorToast(message: "you should add quantity"); } }), ListTile( @@ -153,9 +143,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { color: !isInWishList ? Colors.white : Colors.red[800], ), title: Text( - isInWishList - ? TranslationBase.of(context).removeFromWishlist - : TranslationBase.of(context).addToWishlist, + isInWishList ? TranslationBase.of(context).removeFromWishlist : TranslationBase.of(context).addToWishlist, ), onTap: () async { if (isInWishList) @@ -170,8 +158,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { TranslationBase.of(context).compare, ), onTap: () { - Provider.of(context, listen: false) - .addItem(specificationData); + Provider.of(context, listen: false).addItem(specificationData); Navigator.of(context).pop(); }, ),