miler map
This commit is contained in:
@@ -15,7 +15,7 @@ library;
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode, setEquals;
|
||||
import 'package:flutter/foundation.dart' show kDebugMode, mapEquals, setEquals;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
import 'package:miler/views/helpers/constants/design_constants.dart';
|
||||
@@ -73,6 +73,7 @@ import 'package:miler/views/Dashboard/pickups/stop_verify.dart';
|
||||
import 'package:miler/views/Dashboard/pickups/shipment_capture.dart';
|
||||
import 'package:miler/views/Dashboard/pickups/shipment_review.dart';
|
||||
import 'package:miler/data/milk_run.dart';
|
||||
import 'package:miler/data/next_leg.dart';
|
||||
import 'package:miler/data/order_events.dart';
|
||||
import 'package:miler/data/route_order.dart';
|
||||
import 'package:miler/data/stop_area.dart';
|
||||
@@ -527,6 +528,11 @@ class _MyPickupsState extends State<MyPickups>
|
||||
|
||||
Set<String> _acceptedIds = <String>{};
|
||||
Set<String> _collectedIds = <String>{};
|
||||
|
||||
/// `next_action` per order, as the pivot returned it. Continuity for
|
||||
/// [NextLegResolver] across a rebuild and a poll — see that resolver for why
|
||||
/// it is the lowest rung of the precedence and never an override.
|
||||
Map<String, String> _pivotActions = <String, String>{};
|
||||
Set<String> _outForDeliveryIds = <String>{};
|
||||
Set<String> _notLoadedIds = <String>{};
|
||||
Set<String> _rejectedIds = <String>{};
|
||||
@@ -600,8 +606,6 @@ class _MyPickupsState extends State<MyPickups>
|
||||
return [...done, ...open];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Progress state for every stop on the accepted trip, in the admin's fixed
|
||||
/// order — what drives the red→green rail at the top of Bookings.
|
||||
///
|
||||
@@ -921,7 +925,7 @@ class _MyPickupsState extends State<MyPickups>
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontWeight: FontWeight.w800,
|
||||
letterSpacing: -0.3,
|
||||
color: ColorConstants.slateText,
|
||||
fontFamily: FontConstants.fontFamily,
|
||||
@@ -934,7 +938,7 @@ class _MyPickupsState extends State<MyPickups>
|
||||
style: TextStyle(
|
||||
fontSize: 12.5.sp,
|
||||
height: 1.45,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorConstants.secondaryText,
|
||||
fontFamily: FontConstants.fontFamily,
|
||||
),
|
||||
@@ -958,7 +962,7 @@ class _MyPickupsState extends State<MyPickups>
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
height: 1.5,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: ColorConstants.secondaryText,
|
||||
fontFamily: FontConstants.fontFamily,
|
||||
),
|
||||
@@ -2038,6 +2042,10 @@ class _MyPickupsState extends State<MyPickups>
|
||||
// no tab at all: dropped from Home as collected, withheld from here as
|
||||
// unreleased.
|
||||
final Set<String> collectedIds = await getCollectedOrderIds();
|
||||
final pivotActions = await getPivotNextActions();
|
||||
if (mounted && !mapEquals(_pivotActions, pivotActions)) {
|
||||
setState(() => _pivotActions = pivotActions);
|
||||
}
|
||||
|
||||
// ── Held on the state whatever the line ──
|
||||
//
|
||||
@@ -2092,6 +2100,7 @@ class _MyPickupsState extends State<MyPickups>
|
||||
collectedIds: collectedIds,
|
||||
acceptedIds: acceptedIds,
|
||||
closedIds: closedIds,
|
||||
pivotActions: pivotActions,
|
||||
);
|
||||
|
||||
// Drop stops the rider just finished. The backend may still return them
|
||||
@@ -3285,6 +3294,7 @@ class _MyPickupsState extends State<MyPickups>
|
||||
collectedIds: _collectedIds,
|
||||
outForDeliveryIds:
|
||||
_outForDeliveryIds,
|
||||
pivotActions: _pivotActions,
|
||||
),
|
||||
QueueDensity.next => _NextCard(
|
||||
item: item,
|
||||
|
||||
Reference in New Issue
Block a user