feat: Add checkCircle icon and update ViewOrderCard and ViewOrdersHeader for improved date handling and UI feedback

This commit is contained in:
Achintha Isuru
2026-02-01 21:23:58 -05:00
parent e7d5c29c00
commit 3489ae4060
4 changed files with 81 additions and 57 deletions

View File

@@ -63,6 +63,9 @@ class UiIcons {
/// Checkmark icon /// Checkmark icon
static const IconData check = _IconLib.check; static const IconData check = _IconLib.check;
/// Checkmark circle icon
static const IconData checkCircle = _IconLib.checkCircle;
/// X/Cancel icon /// X/Cancel icon
static const IconData close = _IconLib.x; static const IconData close = _IconLib.x;

View File

@@ -326,15 +326,23 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
if (order.workersNeeded != 0) if (coveragePercent != 100)
const Icon( const Icon(
UiIcons.error, UiIcons.error,
size: 16, size: 16,
color: UiColors.textError, color: UiColors.textError,
), ),
if (coveragePercent == 100)
const Icon(
UiIcons.checkCircle,
size: 16,
color: UiColors.textSuccess,
),
const SizedBox(width: 8), const SizedBox(width: 8),
Text( Text(
'${order.workersNeeded} Workers Needed', coveragePercent == 100
? 'All Workers Confirmed'
: '${order.workersNeeded} Workers Needed',
style: UiTypography.body2m.textPrimary, style: UiTypography.body2m.textPrimary,
), ),
], ],

View File

@@ -182,7 +182,15 @@ class ViewOrdersHeader extends StatelessWidget {
(OrderItem s) => s.date == dateStr, (OrderItem s) => s.date == dateStr,
); );
return GestureDetector( // Check if date is in the past
final DateTime now = DateTime.now();
final DateTime today = DateTime(now.year, now.month, now.day);
final DateTime checkDate = DateTime(date.year, date.month, date.day);
final bool isPast = checkDate.isBefore(today);
return Opacity(
opacity: isPast && !isSelected ? 0.5 : 1.0,
child: GestureDetector(
onTap: () => BlocProvider.of<ViewOrdersCubit>( onTap: () => BlocProvider.of<ViewOrdersCubit>(
context, context,
).selectDate(date), ).selectDate(date),
@@ -245,6 +253,7 @@ class ViewOrdersHeader extends StatelessWidget {
], ],
), ),
), ),
),
); );
}, },
), ),

View File

@@ -25,10 +25,14 @@ dependencies:
path: ../../../domain path: ../../../domain
krow_core: krow_core:
path: ../../../core path: ../../../core
krow_data_connect:
path: ../../../data_connect
# UI # UI
lucide_icons: ^0.257.0 lucide_icons: ^0.257.0
intl: ^0.20.1 intl: ^0.20.1
url_launcher: ^6.3.1 url_launcher: ^6.3.1
firebase_data_connect: ^0.2.2+2
firebase_auth: ^6.1.4
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: