fix coloring issue

merge-update-with-lab-changes
Elham Rababh 5 years ago
parent 58d43f7e46
commit 7de8c2588f

@ -31,7 +31,7 @@ class FooterWidget extends StatefulWidget {
} }
class _FooterWidgetState extends State<FooterWidget> { class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 70; double quantityUI = 80;
bool showUI = false; bool showUI = false;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -77,7 +77,7 @@ class _FooterWidgetState extends State<FooterWidget> {
child: Icon(Icons.close, color: Colors.black), child: Icon(Icons.close, color: Colors.black),
onTap: () { onTap: () {
setState(() { setState(() {
quantityUI = 70; quantityUI = 80;
showUI = false; showUI = false;
}); });
}, },
@ -172,7 +172,7 @@ class _FooterWidgetState extends State<FooterWidget> {
onPressed: () { onPressed: () {
setState(() { setState(() {
if (showUI) { if (showUI) {
quantityUI = 70; quantityUI = 80;
showUI = false; showUI = false;
} else { } else {
quantityUI = 150; quantityUI = 150;
@ -189,7 +189,7 @@ class _FooterWidgetState extends State<FooterWidget> {
disabled: !widget.isAvailable && widget.quantity > 0 || disabled: !widget.isAvailable && widget.quantity > 0 ||
widget.quantity > widget.quantityLimit || widget.quantity > widget.quantityLimit ||
widget.item.rxMessage != null, widget.item.rxMessage != null,
disableColor: Colors.green[400], disableColor: Color(0xFF4CAF50),
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -199,8 +199,9 @@ class _FooterWidgetState extends State<FooterWidget> {
await widget.addToCartFunction( await widget.addToCartFunction(
widget.quantity, widget.item.id, context); widget.quantity, widget.item.id, context);
}, },
borderColor: Color(0xFF4CAF50),
borderRadius: 5, borderRadius: 5,
color: Colors.green, color: Color(0xFF4CAF50),
), ),
), ),
SizedBox( SizedBox(

@ -22,7 +22,7 @@ class ProductNameAndPrice extends StatefulWidget {
final Function deleteFromWishlistFunction; final Function deleteFromWishlistFunction;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
ProductNameAndPrice(this.context, this.item, ProductNameAndPrice(this.context, this.item,
{this.customerId, {this.customerId,
@ -64,50 +64,52 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
: Colors.green, : Colors.green,
), ),
// SizedBox(width: 20), // SizedBox(width: 20),
if(widget.authenticatedUserObject.isLogin) if (widget.authenticatedUserObject.isLogin)
widget.item.stockAvailability == 'Out of stock' && widget.item.stockAvailability == 'Out of stock' &&
widget.customerId != null widget.customerId != null
? InkWell( ? InkWell(
onTap: () => onTap: () => widget.notifyMeWhenAvailable(
widget.notifyMeWhenAvailable(context, widget.item.id), context, widget.item.id),
child: Row(children: [ child: Row(children: [
Texts( Texts(
TranslationBase.of(context).notifyMe, TranslationBase.of(context).notifyMe,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
color: Colors.blue, color: Colors.blue,
), ),
SizedBox(width: 4), SizedBox(width: 4),
Icon( Icon(
FontAwesomeIcons.bell, FontAwesomeIcons.bell,
color: Colors.blue, color: Colors.blue,
size: 15.0, size: 15.0,
) )
]), ]),
) )
: IconWithBg( : IconWithBg(
icon: !widget.isInWishList icon: !widget.isInWishList
? Icons.favorite_border ? Icons.favorite_border
: Icons.favorite, : Icons.favorite,
color: !widget.isInWishList ? Colors.white : Colors.red, color: !widget.isInWishList
onPress: () async { ? Colors.white
{ : Colors.red[800],
if (widget.customerId != null) { onPress: () async {
if (!widget.isInWishList) { {
GifLoaderDialogUtils.showMyDialog(context); if (widget.customerId != null) {
await widget if (!widget.isInWishList) {
.addToWishlistFunction(widget.item.id); GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.hideDialog(context); await widget
.addToWishlistFunction(widget.item.id);
GifLoaderDialogUtils.hideDialog(context);
} else {
await widget
.deleteFromWishlistFunction(widget.item.id);
}
} else { } else {
await widget return;
.deleteFromWishlistFunction(widget.item.id);
} }
} else { setState(() {});
return;
} }
setState(() {}); },
} )
},
)
], ],
), ),
), ),
@ -163,29 +165,32 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
"(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})", "(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})",
fontSize: 12, fontSize: 12,
), ),
SizedBox(
width: 70,
),
if (widget.item.rxMessage != null)
Row(
children: [
Text(
projectViewModel.isArabic
? widget.item.rxMessagen.toString()
: widget.item.rxMessage.toString(),
style: TextStyle(color: Colors.red, fontSize: 10),
),
SizedBox(
width: 5,
),
Icon(
FontAwesomeIcons.questionCircle,
color: Colors.red,
size: 15.0,
)
],
)
], ],
), ),
), ),
), ),
Expanded(
flex: 1,
child: Container(
child: widget.item.rxMessage != null
? Text(
projectViewModel.isArabic
? widget.item.rxMessagen.toString()
: widget.item.rxMessage.toString(),
style: TextStyle(color: Colors.red, fontSize: 10),
)
: Container()),
),
widget.item.rxMessage != null
? Icon(
FontAwesomeIcons.questionCircle,
color: Colors.red,
size: 15.0,
)
: Container(),
], ],
), ),
), ),

@ -17,12 +17,14 @@ class IconWithBg extends StatelessWidget {
color: Colors.grey[200], color: Colors.grey[200],
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
), ),
child: IconButton( child: Center(
icon: Icon(icon), child: IconButton(
color: color, icon: Icon(icon, size: 20,),
onPressed: () async { color: color,
onPress(); onPressed: () async {
}, onPress();
},
),
)); ));
} }
} }

@ -43,7 +43,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
Row( Row(
children: [ children: [
IconWithBg( IconWithBg(
icon: Icons.arrow_back_ios, icon: Icons.arrow_back,
color: Colors.grey, color: Colors.grey,
onPress: () { onPress: () {
Navigator.pop(context); Navigator.pop(context);
@ -56,7 +56,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
children: [ children: [
IconWithBg( IconWithBg(
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
color: Colors.grey, color: Colors.grey[800],
onPress: () { onPress: () {
Navigator.push( Navigator.push(
context, context,

Loading…
Cancel
Save