feat: make hold down bar tile goto edit screen
This commit is contained in:
@@ -323,6 +323,8 @@ class _ProductGrid extends StatelessWidget {
|
||||
product: product,
|
||||
enabled: hasSelectedTab,
|
||||
onTap: () => onProductTap(product),
|
||||
onLongPress: () =>
|
||||
context.go('/products/${product.id}/edit'),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -9,6 +9,7 @@ class ProductTile extends StatelessWidget {
|
||||
final Product product;
|
||||
final bool enabled;
|
||||
final VoidCallback onTap;
|
||||
final VoidCallback? onLongPress;
|
||||
static const _tileImageSize = 280.0;
|
||||
|
||||
const ProductTile({
|
||||
@@ -16,6 +17,7 @@ class ProductTile extends StatelessWidget {
|
||||
required this.product,
|
||||
required this.enabled,
|
||||
required this.onTap,
|
||||
this.onLongPress,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -51,6 +53,7 @@ class ProductTile extends StatelessWidget {
|
||||
color: theme.cardTheme.color ?? scheme.surface,
|
||||
child: InkWell(
|
||||
onTap: enabled && !outOfStock ? onTap : null,
|
||||
onLongPress: onLongPress,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user