return the disable colors

merge-requests/415/head
Elham Rababh 4 years ago
parent 47e19c4ab5
commit 3b79d0ac41

@ -189,13 +189,14 @@ class _FooterWidgetState extends State<FooterWidget> {
disabled: !widget.isAvailable && widget.price > 0 ||
widget.price > widget.quantityLimit ||
widget.item.rxMessage != null,
onTap: () {
disableColor: Colors.green[400],
onTap: () async {
if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
} else
widget.addToCartFunction(
await widget.addToCartFunction(
widget.price, widget.item.id, context);
},
borderRadius: 5,
@ -212,8 +213,8 @@ class _FooterWidgetState extends State<FooterWidget> {
disabled: !widget.isAvailable && widget.price > 0 ||
widget.price > widget.quantityLimit ||
widget.item.rxMessage != null,
onTap: () {
widget.addToCartFunction(
onTap: () async {
await widget.addToCartFunction(
widget.price, widget.item.id, context);
Navigator.push(
context,
@ -221,6 +222,7 @@ class _FooterWidgetState extends State<FooterWidget> {
);
},
borderRadius: 5,
disableColor: Colors.grey[700],
color: !widget.isAvailable && widget.price > 0 ||
widget.price > widget.quantityLimit ||
widget.item.rxMessage != null

@ -357,9 +357,8 @@ convertCityName(txt) {
addToCartFunction(quantity, itemID, BuildContext context) async {
GifLoaderDialogUtils.showMyDialog(context);
ProductDetailViewModel x = new ProductDetailViewModel();
await x.addToCartData(quantity, itemID).then((value) {
GifLoaderDialogUtils.hideDialog(context);
});
await x.addToCartData(quantity, itemID);
GifLoaderDialogUtils.hideDialog(context);
}
notifyMeWhenAvailable(context, itemId) async {

@ -29,7 +29,7 @@ class SecondaryButton extends StatefulWidget {
this.small = false,
this.disabled = false,
this.borderColor,
this.noBorderRadius = false, this.borderRadius})
this.noBorderRadius = false, this.borderRadius, this.disableColor})
: super(key: key);
final String label;
@ -44,6 +44,7 @@ class SecondaryButton extends StatefulWidget {
final bool disabled;
final bool noBorderRadius;
final double borderRadius;
final Color disableColor;
@ -183,7 +184,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: 100,
decoration: BoxDecoration(
color: widget.disabled
? Colors.grey
? widget.disableColor??Colors.grey
: widget.color ?? Theme.of(context).buttonColor),
),
),

Loading…
Cancel
Save