fix cart, fix log cart
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:worker/core/utils/extensions.dart';
|
||||
import 'package:worker/core/widgets/loading_indicator.dart';
|
||||
import 'package:worker/core/theme/typography.dart';
|
||||
@@ -113,34 +113,40 @@ class _CartItemWidgetState extends ConsumerState<CartItemWidget> {
|
||||
|
||||
const SizedBox(width: 12),
|
||||
|
||||
// Product Image (bigger: 100x100)
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: widget.item.product.thumbnail.isNotEmpty
|
||||
? widget.item.product.thumbnail
|
||||
: (widget.item.product.images.isNotEmpty
|
||||
? widget.item.product.images.first
|
||||
: ''),
|
||||
width: 100,
|
||||
height: 100,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
// Product Image (bigger: 100x100) - tap to navigate to product detail
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
// Navigate to product detail with product ID in path
|
||||
context.push('/products/${widget.item.product.productId}');
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: widget.item.product.thumbnail.isNotEmpty
|
||||
? widget.item.product.thumbnail
|
||||
: (widget.item.product.images.isNotEmpty
|
||||
? widget.item.product.images.first
|
||||
: ''),
|
||||
width: 100,
|
||||
height: 100,
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
child: Center(
|
||||
child: CustomLoadingIndicator(color: colorScheme.primary, size: 20),
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) => Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
child: Center(
|
||||
child: CustomLoadingIndicator(color: colorScheme.primary, size: 20),
|
||||
),
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) => Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.image,
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
size: 32,
|
||||
errorWidget: (context, url, error) => Container(
|
||||
width: 100,
|
||||
height: 100,
|
||||
color: colorScheme.surfaceContainerHighest,
|
||||
child: FaIcon(
|
||||
FontAwesomeIcons.image,
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -193,14 +199,15 @@ class _CartItemWidgetState extends ConsumerState<CartItemWidget> {
|
||||
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// Quantity TextField
|
||||
// Quantity TextField - uses text keyboard for Done button on iOS/Android
|
||||
SizedBox(
|
||||
width: 50,
|
||||
height: 32,
|
||||
child: TextField(
|
||||
controller: _quantityController,
|
||||
focusNode: _quantityFocusNode,
|
||||
keyboardType: TextInputType.number,
|
||||
keyboardType: TextInputType.text,
|
||||
textInputAction: TextInputAction.done,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppTypography.titleMedium.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
Reference in New Issue
Block a user