feat: Update NEXT_SPRINT_TASKS with new tasks and modify ViewOrdersCubit to handle null selectedDate
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user