pharmacy updates

merge-update-with-lab-changes
haroon amjad 5 years ago
parent e58b925382
commit 9dbe922259

@ -41,10 +41,9 @@ class _CartOrderPageState extends State<CartOrderPage> {
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
AppScaffold appScaffold; AppScaffold appScaffold;
return NetworkBaseView( return NetworkBaseView(
// baseViewModel: model,
isLoading: isLoading, isLoading: isLoading,
isLocalLoader: true, isLocalLoader: true,
child: AppScaffold( child: appScaffold = AppScaffold(
appBarTitle: TranslationBase.of(context).shoppingCart, appBarTitle: TranslationBase.of(context).shoppingCart,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,

@ -25,19 +25,9 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
final bool isInWishList; final bool isInWishList;
final Function addToCartFunction; final Function addToCartFunction;
ProductAppBar({Key key, this.product, this.model, this.addToWishlistFunction, this.quantity, this.deleteFromWishlistFunction, this.isInWishList, this.addToCartFunction}) : super(key: key);
ProductAppBar( AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
{Key key,
this.product,
this.model,
this.addToWishlistFunction,
this.quantity,
this.deleteFromWishlistFunction,
this.isInWishList, this.addToCartFunction})
: super(key: key);
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -75,23 +65,27 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
onPress: () { onPress: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(builder: (context) => CartOrderPage()),
builder: (context) => CartOrderPage()),
); );
}), }),
if (Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount != 0)
if(Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount !=0)
Positioned( Positioned(
top:0, right: -1.0, top: 0,
right: -1.0,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[800], color: Colors.red[800],
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
padding: EdgeInsets.only(left: 5, right: 4.5), padding: EdgeInsets.only(left: 5, right: 4.5),
height: 18, height: 18,
child: Center(child: Texts(Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)), child: Center(
child: Texts(
Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount.toString(),
style: "caption",
medium: true,
color: Colors.white,
)),
), ),
) )
], ],
@ -135,16 +129,12 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
onTap: () async { onTap: () async {
if (quantity > 0) { if (quantity > 0) {
{ {
await addToCartFunction( await addToCartFunction(quantity: quantity, itemID: itemID, model: model);
quantity: quantity,
itemID: itemID,
model: model);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
AppToast.showErrorToast( AppToast.showErrorToast(message: "you should add quantity");
message: "you should add quantity");
} }
}), }),
ListTile( ListTile(
@ -153,9 +143,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
color: !isInWishList ? Colors.white : Colors.red[800], color: !isInWishList ? Colors.white : Colors.red[800],
), ),
title: Text( title: Text(
isInWishList isInWishList ? TranslationBase.of(context).removeFromWishlist : TranslationBase.of(context).addToWishlist,
? TranslationBase.of(context).removeFromWishlist
: TranslationBase.of(context).addToWishlist,
), ),
onTap: () async { onTap: () async {
if (isInWishList) if (isInWishList)
@ -170,8 +158,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
TranslationBase.of(context).compare, TranslationBase.of(context).compare,
), ),
onTap: () { onTap: () {
Provider.of<CompareList>(context, listen: false) Provider.of<CompareList>(context, listen: false).addItem(specificationData);
.addItem(specificationData);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),

Loading…
Cancel
Save