feat: Update NEXT_SPRINT_TASKS with new tasks and modify ViewOrdersCubit to handle null selectedDate

This commit is contained in:
Achintha Isuru
2026-02-04 08:51:34 -05:00
parent e3268d4722
commit a86a5d9e77
2 changed files with 8 additions and 1 deletions

View File

@@ -16,3 +16,4 @@
- Update the dataconnect docs.
- Track `lat` and `lng` in the staff preferred work locations (for now we are only storing the name).
- Remove "Up Next (x)" counter from orders list in client app as it is confusing, becase the tab already has a badge showing the number of the upcoming orders.
- ` final String status;` in `OrderItem` make it an enum.

View File

@@ -268,10 +268,16 @@ class ViewOrdersCubit extends Cubit<ViewOrdersState> {
}
int _calculateUpNextCount() {
if (state.selectedDate == null) return 0;
final String selectedDateStr = DateFormat(
'yyyy-MM-dd',
).format(state.selectedDate!);
return state.orders
.where(
(OrderItem s) =>
// TODO(orders): move PENDING to its own tab once available.
s.date == selectedDateStr &&
<String>['OPEN', 'FILLED', 'CONFIRMED', 'PENDING', 'ASSIGNED']
.contains(s.status),
)