From 7de8c2588fb333e7830332f02f2f7704f71ca7dc Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 6 Oct 2021 16:17:34 +0300 Subject: [PATCH] fix coloring issue --- .../product-details/footor/footer-widget.dart | 11 +- .../product-name-and-price.dart | 127 +++++++++--------- .../product-details/shared/icon_with_bg.dart | 14 +- .../shared/product_details_app_bar.dart | 4 +- 4 files changed, 82 insertions(+), 74 deletions(-) diff --git a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart index 43abcae5..854f5d4c 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -31,7 +31,7 @@ class FooterWidget extends StatefulWidget { } class _FooterWidgetState extends State { - double quantityUI = 70; + double quantityUI = 80; bool showUI = false; AuthenticatedUserObject authenticatedUserObject = locator(); @@ -77,7 +77,7 @@ class _FooterWidgetState extends State { child: Icon(Icons.close, color: Colors.black), onTap: () { setState(() { - quantityUI = 70; + quantityUI = 80; showUI = false; }); }, @@ -172,7 +172,7 @@ class _FooterWidgetState extends State { onPressed: () { setState(() { if (showUI) { - quantityUI = 70; + quantityUI = 80; showUI = false; } else { quantityUI = 150; @@ -189,7 +189,7 @@ class _FooterWidgetState extends State { disabled: !widget.isAvailable && widget.quantity > 0 || widget.quantity > widget.quantityLimit || widget.item.rxMessage != null, - disableColor: Colors.green[400], + disableColor: Color(0xFF4CAF50), onTap: () async { if (!authenticatedUserObject.isLogin) { Navigator.of(context).pushNamed( @@ -199,8 +199,9 @@ class _FooterWidgetState extends State { await widget.addToCartFunction( widget.quantity, widget.item.id, context); }, + borderColor: Color(0xFF4CAF50), borderRadius: 5, - color: Colors.green, + color: Color(0xFF4CAF50), ), ), SizedBox( diff --git a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart index 4301ce36..31662219 100644 --- a/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart +++ b/lib/pages/pharmacies/screens/product-details/product-name-and-price.dart @@ -22,7 +22,7 @@ class ProductNameAndPrice extends StatefulWidget { final Function deleteFromWishlistFunction; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); ProductNameAndPrice(this.context, this.item, {this.customerId, @@ -64,50 +64,52 @@ class _ProductNameAndPriceState extends State { : Colors.green, ), // SizedBox(width: 20), - if(widget.authenticatedUserObject.isLogin) - widget.item.stockAvailability == 'Out of stock' && - widget.customerId != null - ? InkWell( - onTap: () => - widget.notifyMeWhenAvailable(context, widget.item.id), - child: Row(children: [ - Texts( - TranslationBase.of(context).notifyMe, - decoration: TextDecoration.underline, - color: Colors.blue, - ), - SizedBox(width: 4), - Icon( - FontAwesomeIcons.bell, - color: Colors.blue, - size: 15.0, - ) - ]), - ) - : IconWithBg( - icon: !widget.isInWishList - ? Icons.favorite_border - : Icons.favorite, - color: !widget.isInWishList ? Colors.white : Colors.red, - onPress: () async { - { - if (widget.customerId != null) { - if (!widget.isInWishList) { - GifLoaderDialogUtils.showMyDialog(context); - await widget - .addToWishlistFunction(widget.item.id); - GifLoaderDialogUtils.hideDialog(context); + if (widget.authenticatedUserObject.isLogin) + widget.item.stockAvailability == 'Out of stock' && + widget.customerId != null + ? InkWell( + onTap: () => widget.notifyMeWhenAvailable( + context, widget.item.id), + child: Row(children: [ + Texts( + TranslationBase.of(context).notifyMe, + decoration: TextDecoration.underline, + color: Colors.blue, + ), + SizedBox(width: 4), + Icon( + FontAwesomeIcons.bell, + color: Colors.blue, + size: 15.0, + ) + ]), + ) + : IconWithBg( + icon: !widget.isInWishList + ? Icons.favorite_border + : Icons.favorite, + color: !widget.isInWishList + ? Colors.white + : Colors.red[800], + onPress: () async { + { + if (widget.customerId != null) { + if (!widget.isInWishList) { + GifLoaderDialogUtils.showMyDialog(context); + await widget + .addToWishlistFunction(widget.item.id); + GifLoaderDialogUtils.hideDialog(context); + } else { + await widget + .deleteFromWishlistFunction(widget.item.id); + } } else { - await widget - .deleteFromWishlistFunction(widget.item.id); + return; } - } else { - return; + setState(() {}); } - setState(() {}); - } - }, - ) + }, + ) ], ), ), @@ -163,29 +165,32 @@ class _ProductNameAndPriceState extends State { "(${widget.item.approvedTotalReviews}${TranslationBase.of(context).review})", 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(), ], ), ), diff --git a/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart b/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart index 9033cd72..f2406614 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/icon_with_bg.dart @@ -17,12 +17,14 @@ class IconWithBg extends StatelessWidget { color: Colors.grey[200], borderRadius: BorderRadius.circular(30), ), - child: IconButton( - icon: Icon(icon), - color: color, - onPressed: () async { - onPress(); - }, + child: Center( + child: IconButton( + icon: Icon(icon, size: 20,), + color: color, + onPressed: () async { + onPress(); + }, + ), )); } } diff --git a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart index 95689326..13547fd1 100644 --- a/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart +++ b/lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart @@ -43,7 +43,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ IconWithBg( - icon: Icons.arrow_back_ios, + icon: Icons.arrow_back, color: Colors.grey, onPress: () { Navigator.pop(context); @@ -56,7 +56,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget { children: [ IconWithBg( icon: Icons.shopping_cart, - color: Colors.grey, + color: Colors.grey[800], onPress: () { Navigator.push( context,