return the disable colors

merge-update-with-lab-changes
Elham Rababh 5 years ago
parent 47e19c4ab5
commit 3b79d0ac41

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

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

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

Loading…
Cancel
Save