Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #3536 don't force entry into edit screen on card tap #3540

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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