Skip to content

Commit

Permalink
fix: #3536 don't force entry into edit screen on card tap (#3540)
Browse files Browse the repository at this point in the history
* don't force entry into edit screen on card tap

* remove unused import
  • Loading branch information
AshAman999 authored Jan 6, 2023
1 parent 1190474 commit f39de2a
Showing 1 changed file with 24 additions and 40 deletions.
64 changes: 24 additions & 40 deletions packages/smooth_app/lib/cards/product_cards/product_title_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -28,50 +27,35 @@ class ProductTitleCard extends StatelessWidget {
value: product,
child: Align(
alignment: AlignmentDirectional.topStart,
child: InkWell(
onTap: _hasProductName
? () async {
await Navigator.push<Product?>(
context,
MaterialPageRoute<Product>(
builder: (BuildContext context) =>
AddBasicDetailsPage(product),
),
);
}
: null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: _ProductTitleCardName(
selectable: isSelectable,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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 {
Expand Down

0 comments on commit f39de2a

Please sign in to comment.