pharmacy updates

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

@ -41,10 +41,9 @@ class _CartOrderPageState extends State<CartOrderPage> {
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,

@ -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 authenticatedUserObject = locator<AuthenticatedUserObject>();
@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<OrderPreviewViewModel>(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<OrderPreviewViewModel>(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<OrderPreviewViewModel>(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<OrderPreviewViewModel>(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<CompareList>(context, listen: false)
.addItem(specificationData);
Provider.of<CompareList>(context, listen: false).addItem(specificationData);
Navigator.of(context).pop();
},
),

Loading…
Cancel
Save