From d864037ff5d526c1748e6286bdcdbda09822b10a Mon Sep 17 00:00:00 2001 From: Aman Raj Date: Fri, 6 Jan 2023 19:03:01 +0530 Subject: [PATCH 1/2] don't force entry into edit screen on card tap --- .../product_cards/product_title_card.dart | 63 +++++++------------ 1 file changed, 24 insertions(+), 39 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 bfea86eb24f..e94dca263c3 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 @@ -28,50 +28,35 @@ class ProductTitleCard extends StatelessWidget { value: product, child: Align( alignment: AlignmentDirectional.topStart, - child: InkWell( - onTap: _hasProductName - ? () async { - await Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - AddBasicDetailsPage(product), - ), - ); - } - : null, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: _ProductTitleCardName( - selectable: isSelectable, - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: _ProductTitleCardName( + selectable: isSelectable, ), - Expanded( - child: _ProductTitleCardTrailing( - removable: isRemovable, - selectable: isSelectable, - onRemove: onRemove, - ), - ) - ], - ), - _ProductTitleCardBrand( - removable: isRemovable, - selectable: isSelectable, - ), - ], - ), + ), + Expanded( + child: _ProductTitleCardTrailing( + removable: isRemovable, + selectable: isSelectable, + onRemove: onRemove, + ), + ) + ], + ), + _ProductTitleCardBrand( + removable: isRemovable, + selectable: isSelectable, + ), + ], ), ), ); } - - bool get _hasProductName => product.productName != null; } class _ProductTitleCardName extends StatelessWidget { From 8665a8cf910c81f7aa8514007660be65d64813b7 Mon Sep 17 00:00:00 2001 From: Aman Raj Date: Fri, 6 Jan 2023 19:20:15 +0530 Subject: [PATCH 2/2] remove unused import --- .../smooth_app/lib/cards/product_cards/product_title_card.dart | 1 - 1 file changed, 1 deletion(-) 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 e94dca263c3..72c1b9a85d1 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 @@ -5,7 +5,6 @@ import 'package:provider/provider.dart'; import 'package:smooth_app/generic_lib/design_constants.dart'; import 'package:smooth_app/helpers/extension_on_text_helper.dart'; import 'package:smooth_app/helpers/product_cards_helper.dart'; -import 'package:smooth_app/pages/product/add_basic_details_page.dart'; class ProductTitleCard extends StatelessWidget { const ProductTitleCard(