From 81ab9acf460101febd547184fe3b696101636bdd Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sun, 30 Jul 2023 09:11:52 +0200 Subject: [PATCH] When there is just a close button, the product title card button should not be 50/50 --- .../product_cards/product_title_card.dart | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/smooth_app/lib/cards/product_cards/product_title_card.dart b/packages/smooth_app/lib/cards/product_cards/product_title_card.dart index 0e45efce003..27b7c94ff46 100644 --- a/packages/smooth_app/lib/cards/product_cards/product_title_card.dart +++ b/packages/smooth_app/lib/cards/product_cards/product_title_card.dart @@ -23,6 +23,16 @@ class ProductTitleCard extends StatelessWidget { @override Widget build(BuildContext context) { + Widget title = _ProductTitleCardTrailing( + removable: isRemovable, + selectable: isSelectable, + onRemove: onRemove, + ); + + if (!(isRemovable && !isSelectable)) { + title = Expanded(child: title); + } + return Provider.value( value: product, child: Align( @@ -38,13 +48,7 @@ class ProductTitleCard extends StatelessWidget { selectable: isSelectable, ), ), - Expanded( - child: _ProductTitleCardTrailing( - removable: isRemovable, - selectable: isSelectable, - onRemove: onRemove, - ), - ) + title, ], ), _ProductTitleCardBrand(