miler map

This commit is contained in:
2026-09-09 12:55:23 +05:30
parent 074cc0eccf
commit 127fa062ed
143 changed files with 4315 additions and 2291 deletions

View File

@@ -59,6 +59,19 @@ class PickupCard extends StatelessWidget {
/// off the row's raw status.
final Set<String> outForDeliveryIds;
/// `next_action` per order, as the pivot returned it.
///
/// Only needed to tell a **hub-routed** parcel from one whose routing has not
/// been reported yet: both sit on `Created`, and only the recorded pivot
/// instruction separates them. Everything else the card asks resolves from
/// the row's own `consignmentstatus`.
///
/// Defaulting to empty is safe by construction — without it a hub parcel
/// reads as [NextLeg.unknown], which withholds the customer destination and
/// the Start-delivery control exactly as the hub leg does. It loses the
/// precise wording, never the guard.
final Map<String, String> pivotActions;
const PickupCard({
super.key,
required this.item,
@@ -70,6 +83,7 @@ class PickupCard extends StatelessWidget {
this.label = '',
this.collectedIds = const {},
this.outForDeliveryIds = const {},
this.pivotActions = const {},
});
String _val(List<String> keys, [String fallback = '']) {
@@ -101,6 +115,17 @@ class PickupCard extends StatelessWidget {
// his box. See [MilkRun.workingKind].
final StopKind kind = MilkRun.workingKind(item, collectedIds: collectedIds);
// ── Where this parcel goes next, per order ──
//
// The card used to answer this from [ServiceProfile.deliversToCustomer] — a
// line-level constant — which is false on logistics. So a hyperlocal parcel
// already released into the rider's hands drew its *sender* as the
// destination, and a Chennai-bound one drew a receiver he is never going to.
final NextLegDecision leg = NextLegResolver.resolve(
item,
pivotAction: pivotActions[MilkRun.idOf(item)] ?? '',
);
final String customer = _val([
'pickupcustomer',
'tenantname',
@@ -129,8 +154,12 @@ class PickupCard extends StatelessWidget {
// customer names the pickup, and the drop end appears only if the
// payload actually carries one.
final String source = stopSourceName(item);
final bool pickupIsSource =
ServiceProfile.active.deliversToCustomer && source.isNotEmpty;
// The receiver names the far end whenever the rider is carrying it there —
// whether that is a milk round (line-level) or a hyperlocal parcel the
// backend routed direct (per-order).
final bool carryingToCustomer =
ServiceProfile.active.deliversToCustomer || leg.isCustomer;
final bool pickupIsSource = carryingToCustomer && source.isNotEmpty;
final String pickupName = pickupIsSource ? source : customer;
final String dropAddress = _val(['dropaddress', 'DropAddress']);
final String dropName = pickupIsSource
@@ -139,8 +168,16 @@ class PickupCard extends StatelessWidget {
/// True once the rider is carrying it: the drop becomes the destination and
/// takes the top of the card.
// ── The immediate destination leads; never a hub leg's receiver ──
//
// On [NextLeg.hub] the receiver is in another district and the rider is
// going to a hub. Letting that address take the headline is the navigation
// mistake this whole change exists to prevent, so a hub leg never leads
// with a drop — the final destination is demoted to context below.
final bool dropLeads =
pickupIsSource && (dropName.isNotEmpty || dropAddress.isNotEmpty);
!leg.isHub &&
(pickupIsSource || leg.isCustomer) &&
(dropName.isNotEmpty || dropAddress.isNotEmpty);
// ── No accent stripe any more ──
//
@@ -217,6 +254,30 @@ class PickupCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
// ── What kind of journey this is, above the name ──
//
// HUB HANDOVER and CUSTOMER DELIVERY are different
// physical acts with different endings, and the row
// has to say which before the rider reads the place.
// Drawn only once the parcel is actually his; an
// uncollected stop has no leg yet.
if (leg.leg.eyebrow.isNotEmpty) ...[
Text(
leg.leg.eyebrow,
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w800,
letterSpacing: 0.8,
color: leg.isHub
? ColorConstants.deliveryAccent
: leg.isUnknown
? ColorConstants.warning
: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
),
SizedBox(height: 3.h),
],
Text(
(dropLeads ? dropName : pickupName).isEmpty
? 'Not named'
@@ -225,7 +286,7 @@ class PickupCard extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 22.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
height: 1.1,
letterSpacing: -0.6,
color: ColorConstants.slateText,
@@ -264,7 +325,7 @@ class PickupCard extends StatelessWidget {
style: TextStyle(
fontSize: 15.sp,
height: 1.35,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -357,7 +418,7 @@ class PickupCard extends StatelessWidget {
style: TextStyle(
fontSize: 14.5.sp,
height: 1.35,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.warning,
fontFamily: FontConstants.fontFamily,
),
@@ -390,7 +451,7 @@ class PickupCard extends StatelessWidget {
'PICKED UP FROM',
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: 0.8,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -409,7 +470,7 @@ class PickupCard extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
height: 1.2,
color: ColorConstants.slateText,
@@ -462,7 +523,7 @@ class PickupCard extends StatelessWidget {
child: Text(
'Finish the current stop first',
style: TextStyle(
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontSize: 14.sp,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -627,7 +688,7 @@ class _JourneyBlock extends StatelessWidget {
distance,
style: TextStyle(
fontSize: 15.5.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: -0.3,
color: fg,
fontFamily: FontConstants.fontFamily,
@@ -641,7 +702,7 @@ class _JourneyBlock extends StatelessWidget {
'~$travel',
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -687,7 +748,7 @@ class _DistanceEta extends StatelessWidget {
travel == '—' ? distance : '$distance · ~$travel',
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
color: fg,
fontFamily: FontConstants.fontFamily,
@@ -737,7 +798,7 @@ class _ActionLine extends StatelessWidget {
TextStyle style(Color c) => TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: c,
fontFamily: FontConstants.fontFamily,
);
@@ -1040,7 +1101,7 @@ class _QueueHeading extends StatelessWidget {
label,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: 1.2,
color: live
? ColorConstants.primary
@@ -1054,7 +1115,7 @@ class _QueueHeading extends StatelessWidget {
'$count',
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1129,7 +1190,7 @@ class _LabelPair extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: size.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: -0.2,
color: muted
? ColorConstants.secondaryText
@@ -1147,7 +1208,7 @@ class _LabelPair extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: size.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -1212,7 +1273,7 @@ class _TaskChip extends StatelessWidget {
maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: 1.0,
color: look.color,
fontFamily: FontConstants.fontFamily,
@@ -1268,7 +1329,7 @@ class _NextCard extends StatelessWidget {
// in position, which is what makes their labels a
// convenience rather than the only thing ranking them.
fontSize: 17.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
height: 1.15,
letterSpacing: -0.4,
color: ColorConstants.slateText,
@@ -1292,7 +1353,7 @@ class _NextCard extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1349,7 +1410,7 @@ class _LaterRow extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
letterSpacing: -0.3,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -1361,7 +1422,7 @@ class _LaterRow extends StatelessWidget {
RouteMetricsHelper.formatDistance(distanceMeters),
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1417,7 +1478,7 @@ class _SkippedRow extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.4,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -1436,7 +1497,7 @@ class _SkippedRow extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
height: 1.3,
color: ColorConstants.warning,
fontFamily: FontConstants.fontFamily,
@@ -1447,7 +1508,12 @@ class _SkippedRow extends StatelessWidget {
Row(
children: [
if (label.isNotEmpty) ...[
_LabelPair(label: label, customer: '', muted: true, size: 13.5),
_LabelPair(
label: label,
customer: '',
muted: true,
size: 13.5,
),
SizedBox(width: 12.w),
],
Expanded(

View File

@@ -8,6 +8,7 @@ import 'package:slider_button_lite/feature/presentation/slider_button/slider_but
import 'package:miler/views/Dashboard/pickups/stop_type.dart';
import 'package:miler/views/helpers/constants/Colorconstants.dart';
import 'package:miler/views/helpers/constants/miler_surface.dart';
import 'package:miler/views/helpers/constants/design_constants.dart';
import 'package:miler/views/helpers/constants/Font_constant.dart';
import 'package:miler/views/helpers/widgets/app_widgets.dart';
@@ -325,7 +326,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
// Grey page, white bands — the same shape the verification screens this
// follows now take, so the money step reads as the next page of one flow
// rather than a different screen. See [MilerBand].
backgroundColor: ColorConstants.daylightSurface,
backgroundColor: MilerSurface.canvas,
// Same bar as the verification screens this follows: taller, clear of
// the notch, title at a size that survives sunlight and arm's length.
appBar: milerPageBar(
@@ -377,7 +378,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'DUE AT THIS STOP',
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.8,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -391,7 +392,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'₹${_fmt(_due)}',
style: TextStyle(
fontSize: 42.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -1.6,
height: 1.05,
color: ColorConstants.slateText,
@@ -406,7 +407,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -457,7 +458,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
label,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: strong ? FontWeight.w700 : FontWeight.w500,
fontWeight: strong ? FontWeight.w800 : FontWeight.w600,
color: strong
? ColorConstants.slateText
: ColorConstants.secondaryText,
@@ -469,7 +470,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
value,
style: TextStyle(
fontSize: strong ? 14.sp : 12.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: strong
? ColorConstants.slateText
: ColorConstants.secondaryText,
@@ -529,7 +530,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
style: TextStyle(
fontSize: 12.sp,
height: 1.35,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -555,7 +556,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -570,7 +571,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -628,7 +629,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'Show this to the customer',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.upiPurple,
fontFamily: FontConstants.fontFamily,
),
@@ -666,7 +667,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -677,7 +678,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -719,7 +720,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
m.label,
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -728,7 +729,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
m.blurb,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -821,7 +822,6 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
final onBehalf = _shipper.isNotEmpty ? _shipper : 'the shipper';
return MilerBand(
color: ColorConstants.tint(ColorConstants.tertiary, 0.08),
rail: ColorConstants.tertiary,
padding: EdgeInsets.fromLTRB(MilerBand.pad, 13.h, MilerBand.pad, 13.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -835,7 +835,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
style: TextStyle(
fontSize: 12.sp,
height: 1.4,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.tertiary,
fontFamily: FontConstants.fontFamily,
),
@@ -869,7 +869,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -884,7 +884,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'Customer cannot pay',
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.errorRed,
fontFamily: FontConstants.fontFamily,
),
@@ -929,7 +929,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'Finish the details above',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -953,7 +953,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),
@@ -982,7 +982,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'Collect payment',
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -1004,7 +1004,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
'Nothing to collect here',
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -1016,7 +1016,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
style: TextStyle(
fontSize: 13.sp,
height: 1.4,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1051,7 +1051,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
title,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -1086,7 +1086,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: selected ? Colors.white : ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -1113,7 +1113,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
onChanged: (_) => setState(() {}),
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -1121,7 +1121,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
hintText: hint,
hintStyle: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1167,7 +1167,7 @@ class _CollectPaymentPageState extends State<CollectPaymentPage> {
style: TextStyle(
fontSize: 12.sp,
height: 1.35,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: accent,
fontFamily: FontConstants.fontFamily,
),

View File

@@ -269,6 +269,42 @@ bool get _handoffHoldIsPossible => ServiceProfile.active.endsAtHub;
Future<bool> releaseForDelivery(Map<String, dynamic> stop) async {
lastReleaseFailure = null;
// ── A hub-routed parcel has no customer round to start ──
//
// This is the gate that keeps a Gandhipuram → Chennai consignment out of the
// delivery lifecycle. `start-delivery` moves it to `Out_for_Delivery` against
// a receiver 500km away, the hub then sees a rider "actively delivering" a
// parcel that is going onto a line-haul truck, and there is no way back from
// that state on the handset.
//
// Asked of the order, never of the line — see [NextLegResolver]. The pivot's
// own instruction is read from the store because that is the only place the
// routing answer survives a rebuild; `GET /miler/bookings` does not carry it.
final leg = NextLegResolver.resolve(
stop,
pivotAction: (await getPivotNextActions())[MilkRun.idOf(stop)] ?? '',
);
if (leg.isHub) {
debugPrint('[NEXTLEG] release refused for ${MilkRun.idOf(stop)} — $leg');
lastReleaseFailure =
'This parcel goes back to base, not to the customer. Hand it over at '
'base — there is no delivery to start here.';
return false;
}
// ── `unknown` is NOT refused here, deliberately ──
//
// It would be the cautious-looking thing to do and it is the wrong thing.
// A row that says nothing is exactly the case the consignment re-read below
// exists for: `Created` and a blank status both arrive on a poll that is
// behind the rider, and the server is the judge of its own consignment.
// Refusing here short-circuits that read and strands a rider on a stop the
// server would have released — the failure `_handoffHoldIsPossible` already
// documents, arriving by a new route.
//
// Only [NextLeg.hub] is refused, because that is the one answer the server
// has actually given.
final consignmentId = await resolveConsignmentId(stop);
if (consignmentId.isEmpty) {
debugPrint('[MILKRUN] no consignment id for ${MilkRun.idOf(stop)}');
@@ -292,8 +328,7 @@ Future<bool> releaseForDelivery(Map<String, dynamic> stop) async {
// custody and refused, and no amount of sliding cleared a row that only the
// next poll was going to correct. It is asked directly instead — one request,
// on the one state where the row is not evidence.
if (state == ConsignmentState.unknown ||
state == ConsignmentState.created) {
if (state == ConsignmentState.unknown || state == ConsignmentState.created) {
state = await ConsignmentGate.stateOf(consignmentId);
}
if (state.isDeliverable || state.isDelivered) {

View File

@@ -7,6 +7,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:miler/data/proof_store.dart';
import 'package:miler/views/helpers/constants/Colorconstants.dart';
import 'package:miler/views/helpers/constants/miler_surface.dart';
import 'package:miler/views/helpers/constants/design_constants.dart';
import 'package:miler/views/helpers/constants/Font_constant.dart';
import 'package:miler/views/helpers/widgets/app_widgets.dart';
@@ -214,7 +215,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
final hasShot = _shotPath != null;
return Scaffold(
backgroundColor: ColorConstants.daylightSurface,
backgroundColor: MilerSurface.canvas,
appBar: const MilerAppBar(title: 'Proof of delivery', showBack: true),
body: SafeArea(
top: false,
@@ -286,7 +287,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
'Handing over to',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -298,7 +299,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.4,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -384,7 +385,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -442,7 +443,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.4,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -457,7 +458,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
style: TextStyle(
fontSize: 13.5.sp,
height: 1.45,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -528,7 +529,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
"Couldn't hand it over?",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
letterSpacing: -0.1,
color: Narrative.inkMuted,
fontFamily: FontConstants.fontFamily,
@@ -542,7 +543,7 @@ class _DeliveryProofPageState extends State<DeliveryProofPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.warning,
fontFamily: FontConstants.fontFamily,
),

View File

@@ -390,7 +390,7 @@ class _PickupsDoneState extends State<PickupsDone>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
color: tone,
fontFamily: FontConstants.fontFamily,
@@ -436,7 +436,7 @@ class _PickupsDoneState extends State<PickupsDone>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 28.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.9,
height: 1.08,
color: ColorConstants.slateText,
@@ -451,7 +451,7 @@ class _PickupsDoneState extends State<PickupsDone>
style: TextStyle(
fontSize: 14.5.sp,
height: 1.45,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.onSurfaceVariant,
fontFamily: FontConstants.fontFamily,
),
@@ -478,7 +478,7 @@ class _PickupsDoneState extends State<PickupsDone>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: kind.accent,
fontFamily: FontConstants.fontFamily,
),
@@ -514,7 +514,7 @@ class _PickupsDoneState extends State<PickupsDone>
style: TextStyle(
fontSize: 12.5.sp,
height: 1.35,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.warning,
fontFamily: FontConstants.fontFamily,
),
@@ -588,7 +588,7 @@ class _PickupsDoneState extends State<PickupsDone>
'$position',
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: kind.accent,
fontFamily: FontConstants.fontFamily,
),
@@ -605,7 +605,7 @@ class _PickupsDoneState extends State<PickupsDone>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
letterSpacing: -0.2,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -619,7 +619,7 @@ class _PickupsDoneState extends State<PickupsDone>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -661,7 +661,7 @@ class _PickupsDoneState extends State<PickupsDone>
'Finding your next stop…',
style: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -702,7 +702,7 @@ class _PickupsDoneState extends State<PickupsDone>
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.6,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -716,7 +716,7 @@ class _PickupsDoneState extends State<PickupsDone>
style: TextStyle(
fontSize: 14.sp,
height: 1.5,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -775,7 +775,7 @@ class _PickupsDoneState extends State<PickupsDone>
// least readable combination in the app, on the screen a rider glances at
// between two stops.
fontSize: 12.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.9,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -783,7 +783,7 @@ class _PickupsDoneState extends State<PickupsDone>
TextStyle get _metaStyle => TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
);
@@ -828,7 +828,7 @@ class _PickupsDoneState extends State<PickupsDone>
'You Won a Bonus!',
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -910,7 +910,7 @@ class _PickupsDoneState extends State<PickupsDone>
'${widget.bonusPoints}',
style: TextStyle(
fontSize: 52.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
letterSpacing: -2,
@@ -920,7 +920,7 @@ class _PickupsDoneState extends State<PickupsDone>
'Bonus Points',
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.onSurfaceVariant,
fontFamily: FontConstants.fontFamily,
),

View File

@@ -1018,7 +1018,7 @@ class _PickupMapScreenState extends State<_PickupMapScreen>
'Finding the route',
style: MilerType.micro.copyWith(
fontSize: 12.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
),
),
],
@@ -1491,7 +1491,7 @@ class _PickupMapScreenState extends State<_PickupMapScreen>
"Couldn't deliver? Skip or cancel",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
letterSpacing: -0.1,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -1519,9 +1519,7 @@ class _PickupMapScreenState extends State<_PickupMapScreen>
// rider is setting off. Naming it after the app that opens — navigate —
// described the side effect rather than the thing he is doing, and it
// read as a different job from the delivery leg's identical step.
label: onTheWay
? "Slide to confirm you've arrived"
: 'Slide to start ride',
label: onTheWay ? "Arrived" : 'Start ride',
icon: onTheWay ? LucideIcons.check : LucideIcons.navigation,
// Green advances the job, maroon is brand and navigation.
color: onTheWay ? ColorConstants.acceptGreen : ColorConstants.primary,
@@ -2477,7 +2475,7 @@ class _LiveEtaHeader extends StatelessWidget {
style: TextStyle(
fontSize: known ? 34.sp : 20.sp,
height: 1.0,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: -1.4,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -2494,7 +2492,7 @@ class _LiveEtaHeader extends StatelessWidget {
style: TextStyle(
fontSize: 17.sp,
height: 1.0,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.5,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,

View File

@@ -553,7 +553,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
style: TextStyle(
fontFamily: FontConstants.fontFamily,
color: Colors.white,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontSize: 14.sp,
),
),
@@ -576,7 +576,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
style: TextStyle(
fontFamily: FontConstants.fontFamily,
color: Colors.white,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontSize: 12.sp,
),
),
@@ -606,7 +606,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
fontFamily: FontConstants.fontFamily,
fontSize: 16.sp,
color: ColorConstants.slateText,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 8),
@@ -615,7 +615,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
style: TextStyle(
fontFamily: FontConstants.fontFamily,
fontSize: 18.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
),
),
@@ -646,7 +646,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
fontFamily: FontConstants.fontFamily,
fontSize: 16.sp,
color: ColorConstants.slateText,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 8),
@@ -655,7 +655,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
style: TextStyle(
fontFamily: FontConstants.fontFamily,
fontSize: 18.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
),
),
@@ -687,7 +687,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
fontFamily: FontConstants.fontFamily,
fontSize: 16.sp,
color: ColorConstants.slateText,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
),
),
const SizedBox(height: 4),
@@ -696,7 +696,7 @@ class _MultiCustomerMapScreenState extends State<MultiCustomerMapScreen>
style: TextStyle(
fontFamily: FontConstants.fontFamily,
fontSize: 18.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
),
),

View File

@@ -174,7 +174,7 @@ class _PaymentScreenState extends State<PaymentScreen>
'Payment Collected Successfully',
style: TextStyle(
fontSize: 26.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -245,7 +245,7 @@ class _PaymentScreenState extends State<PaymentScreen>
'Payment Receipt',
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -356,7 +356,7 @@ class _PaymentScreenState extends State<PaymentScreen>
value,
style: TextStyle(
fontSize: 14.sp,
fontWeight: valueBold ? FontWeight.w600 : FontWeight.w500,
fontWeight: valueBold ? FontWeight.w700 : FontWeight.w600,
color: valueColor ?? ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -418,7 +418,7 @@ class _PaymentScreenState extends State<PaymentScreen>
'Payment Collection',
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
letterSpacing: 0.5,
@@ -452,7 +452,7 @@ class _PaymentScreenState extends State<PaymentScreen>
'₹${_totalAmount.toStringAsFixed(0)}',
style: TextStyle(
fontSize: 36.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
letterSpacing: -1,
@@ -483,7 +483,7 @@ class _PaymentScreenState extends State<PaymentScreen>
'#$_orderId',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),
@@ -642,7 +642,7 @@ class _PaymentScreenState extends State<PaymentScreen>
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),
@@ -690,7 +690,7 @@ class _PaymentScreenState extends State<PaymentScreen>
label,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.onSurfaceVariant,
fontFamily: FontConstants.fontFamily,
letterSpacing: 0.5,
@@ -759,7 +759,7 @@ class _PaymentScreenState extends State<PaymentScreen>
title,
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -814,7 +814,7 @@ class _PaymentScreenState extends State<PaymentScreen>
style: TextStyle(
fontSize: isTotal ? 15.sp : 13.sp,
color: ColorConstants.onSurfaceVariant,
fontWeight: isBold ? FontWeight.w500 : FontWeight.normal,
fontWeight: isBold ? FontWeight.w600 : FontWeight.normal,
fontFamily: FontConstants.fontFamily,
),
),
@@ -823,8 +823,8 @@ class _PaymentScreenState extends State<PaymentScreen>
style: TextStyle(
fontSize: isTotal ? 17.sp : 14.sp,
fontWeight: isTotal
? FontWeight.w700
: (isBold ? FontWeight.w600 : FontWeight.w500),
? FontWeight.w800
: (isBold ? FontWeight.w700 : FontWeight.w600),
color: isTotal
? ColorConstants.primary
: ColorConstants.onSurface,

View File

@@ -272,7 +272,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
style: TextStyle(
fontSize: 21.sp,
color: ColorConstants.onSurface,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
fontFamily: FontConstants.fontFamily,
),
),
@@ -348,7 +348,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
label,
style: TextStyle(
fontSize: 10.sp,
fontWeight: done ? FontWeight.w600 : FontWeight.w500,
fontWeight: done ? FontWeight.w700 : FontWeight.w600,
color: done
? _successGreen
: ColorConstants.onSurfaceVariant,
@@ -412,7 +412,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
fontFamily: FontConstants.fontFamily,
),
),
@@ -427,7 +427,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
_customerName,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),
@@ -489,7 +489,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
label,
style: TextStyle(
fontSize: 9.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: accentColor,
letterSpacing: 0.8,
fontFamily: FontConstants.fontFamily,
@@ -541,7 +541,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
title,
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -558,7 +558,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
badge,
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: _primaryRed,
fontFamily: FontConstants.fontFamily,
),
@@ -679,7 +679,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
'Tap to take parcel photo',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.onSurfaceVariant,
fontFamily: FontConstants.fontFamily,
),
@@ -738,7 +738,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
label,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),
@@ -750,7 +750,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
style: TextStyle(
fontSize: 13.sp,
color: _primaryRed,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontFamily: FontConstants.fontFamily,
),
),
@@ -806,7 +806,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
: 'Complete all fields to continue',
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -844,7 +844,7 @@ class _PickupVerificationPageState extends State<PickupVerificationPage>
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),

View File

@@ -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,

View File

@@ -112,7 +112,7 @@ class _PipInfoCardState extends State<PipInfoCard> {
'Out',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.primary,
fontFamily: FontConstants.fontFamily,
),
@@ -133,7 +133,7 @@ class _PipInfoCardState extends State<PipInfoCard> {
strokeCap: StrokeCap.round,
textStyle: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.primary,
fontFamily: FontConstants.fontFamily,
),
@@ -157,7 +157,7 @@ class _PipInfoCardState extends State<PipInfoCard> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.onSurface,
fontFamily: FontConstants.fontFamily,
),

View File

@@ -138,7 +138,7 @@ class _PickupBottomSheetState extends State<_PickupBottomSheet>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
color: color,
fontFamily: FontConstants.fontFamily,
@@ -253,7 +253,7 @@ class _PickupBottomSheetState extends State<_PickupBottomSheet>
modeLabel,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: confirmColor,
fontFamily: FontConstants.fontFamily,
),
@@ -281,7 +281,7 @@ class _PickupBottomSheetState extends State<_PickupBottomSheet>
: confirmLabel,
style: TextStyle(
fontSize: 19.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
fontFamily: FontConstants.fontFamily,
color: ColorConstants.onSurface,
),
@@ -383,7 +383,7 @@ class _PickupBottomSheetState extends State<_PickupBottomSheet>
isDelivery ? 'Delivered' : 'Picked up',
style: TextStyle(
fontSize: 16.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.3,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
@@ -557,7 +557,7 @@ class _PickupBottomSheetState extends State<_PickupBottomSheet>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),
@@ -1306,7 +1306,7 @@ class _StopBrief extends StatelessWidget {
style: TextStyle(
color: ColorConstants.secondaryText,
fontSize: 14.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
fontFamily: FontConstants.fontFamily,
),
),
@@ -1322,7 +1322,7 @@ class _StopBrief extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 15.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.3,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -1345,7 +1345,7 @@ class _StopBrief extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1387,7 +1387,7 @@ class _StopBrief extends StatelessWidget {
kind.locationLabel,
style: TextStyle(
fontSize: 9.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.6,
color: ColorConstants.primary,
fontFamily: FontConstants.fontFamily,
@@ -1401,7 +1401,7 @@ class _StopBrief extends StatelessWidget {
style: TextStyle(
fontSize: 13.sp,
height: 1.35,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.onSurfaceVariant,
fontFamily: FontConstants.fontFamily,
),

View File

@@ -8,6 +8,7 @@ import 'package:geolocator/geolocator.dart';
import 'package:miler/data/miler_api.dart';
import 'package:miler/views/helpers/constants/Colorconstants.dart';
import 'package:miler/views/helpers/constants/miler_surface.dart';
import 'package:miler/views/helpers/constants/design_constants.dart';
import 'package:miler/views/helpers/constants/Font_constant.dart';
import 'package:miler/views/helpers/widgets/app_widgets.dart';
@@ -289,7 +290,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorConstants.daylightSurface,
backgroundColor: MilerSurface.canvas,
appBar: milerPageBar('Shipment details'),
body: SafeArea(
child: Column(
@@ -331,7 +332,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -488,7 +489,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
label,
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: 1.2,
color: tint,
fontFamily: FontConstants.fontFamily,
@@ -533,7 +534,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
'THE PARCEL',
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: 1.2,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -597,7 +598,6 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
color: priced
? ColorConstants.tint(ColorConstants.acceptGreen, 0.06)
: ColorConstants.pureSurface,
rail: priced ? ColorConstants.acceptGreen : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -613,7 +613,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
'WHAT THE CUSTOMER PAYS',
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: 1.2,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -631,7 +631,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
quote.currency,
style: TextStyle(
fontSize: 17.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.acceptGreen,
fontFamily: FontConstants.fontFamily,
),
@@ -645,7 +645,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
style: TextStyle(
fontSize: 34.sp,
height: 1.05,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: -1.2,
color: ColorConstants.acceptGreen,
fontFamily: FontConstants.fontFamily,
@@ -661,7 +661,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
'${quote.maxPrice.toStringAsFixed(0)} · charging the lower',
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -697,7 +697,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
'Getting the price…',
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -715,7 +715,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
'Enter both pincodes and the weight to get a price.',
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -742,7 +742,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
label,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -752,7 +752,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
value,
style: TextStyle(
fontSize: emphasis ? 17.sp : 13.sp,
fontWeight: emphasis ? FontWeight.w800 : FontWeight.w600,
fontWeight: emphasis ? FontWeight.w900 : FontWeight.w700,
color: emphasis
? ColorConstants.primary
: ColorConstants.slateText,
@@ -768,7 +768,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
note,
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -798,7 +798,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
onChanged: (_) => setState(() {}),
style: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -807,10 +807,20 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
hintText: hint,
prefixIcon: Icon(icon, size: 18.sp),
filled: true,
fillColor: ColorConstants.pureSurface,
// ── A field on a white card needs a ground of its own ──
//
// This was `pureSurface` — white type on white inside a white card,
// separated from it by a hairline alone. It read as a line drawn on the
// card rather than as somewhere to type, and at arm's length in sun the
// hairline is the first thing to go.
//
// The canvas is the app's own "one step back from a surface" tone, so a
// field wearing it sits *in* the card the way a well does, and the
// hairline becomes the edge of a shape rather than the whole of it.
fillColor: MilerSurface.canvas,
hintStyle: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -844,7 +854,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
label,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -879,7 +889,7 @@ class _ShipmentCapturePageState extends State<ShipmentCapturePage> {
v,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: v == selected
? ColorConstants.onAccent
: ColorConstants.slateText,

View File

@@ -3,6 +3,7 @@ import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:miler/views/helpers/constants/Colorconstants.dart';
import 'package:miler/views/helpers/constants/miler_surface.dart';
import 'package:miler/views/helpers/constants/design_constants.dart';
import 'package:miler/views/helpers/constants/Font_constant.dart';
import 'package:miler/views/helpers/widgets/app_widgets.dart';
@@ -192,7 +193,14 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
// Once the order exists, going back would offer to create it twice.
canPop: !_created && !_busy,
child: Scaffold(
backgroundColor: ColorConstants.daylightSurface,
// ── The canvas, not the old slate ──
//
// This was `daylightSurface` — #DEE3EA, the heavy grey the whole app
// used to sit on. The ground moved to a near-white canvas when cards
// took on a hairline and a lift (see [Narrative]); these screens kept
// the old value, so the flow a rider spends the most time in was the
// one place still showing dark bars between its sections.
backgroundColor: MilerSurface.canvas,
appBar: _created ? null : milerPageBar('Review & pay'),
body: SafeArea(child: _created ? _successView() : _reviewView()),
),
@@ -306,7 +314,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
label,
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.6,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
@@ -317,7 +325,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
address.isEmpty ? 'Not captured' : address,
style: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
height: 1.3,
color: address.isEmpty
? ColorConstants.secondaryText
@@ -332,7 +340,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
tail,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -403,7 +411,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
'Amount to collect',
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -413,7 +421,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
_amountLabel,
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: -0.4,
color: ColorConstants.primary,
fontFamily: FontConstants.fontFamily,
@@ -434,9 +442,15 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
duration: DesignConstants.motionState,
padding: EdgeInsets.symmetric(vertical: 12.h),
decoration: BoxDecoration(
// The unselected tile was `daylightSurface` — the old slate — so on a
// white card the option he has *not* chosen was the heaviest shape in
// the group, and the two read as one filled and one disabled rather
// than as a choice between two. Unselected is the card's own white
// with a hairline, which is how every other pair of options in this
// flow is drawn.
color: selected
? ColorConstants.tint(ColorConstants.primary, 0.08)
: ColorConstants.daylightSurface,
: ColorConstants.pureSurface,
borderRadius: BorderRadius.circular(DesignConstants.radiusLg),
border: Border.all(
color: selected
@@ -459,7 +473,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
m.label,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: selected
? ColorConstants.primary
: ColorConstants.slateText,
@@ -509,7 +523,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
label,
style: TextStyle(
fontSize: 12.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -519,7 +533,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
value.isEmpty ? '—' : value,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -533,7 +547,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
note,
style: TextStyle(
fontSize: 10.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -624,7 +638,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 19.sp,
fontWeight: FontWeight.w800,
fontWeight: FontWeight.w900,
letterSpacing: -0.4,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -638,7 +652,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -654,7 +668,9 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
vertical: 10.h,
),
decoration: BoxDecoration(
color: ColorConstants.daylightSurface,
// A well inside a white card, so it takes the canvas
// rather than the old slate the page used to sit on.
color: MilerSurface.canvas,
borderRadius: BorderRadius.circular(
DesignConstants.radiusFull,
),
@@ -673,7 +689,7 @@ class _ShipmentReviewPageState extends State<ShipmentReviewPage>
tracking,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.3,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,

View File

@@ -110,7 +110,7 @@ Future<void> _showMyOptionsSheet(
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
fontFamily: FontConstants.fontFamily,
color: ColorConstants.onSurface,
),
@@ -150,7 +150,7 @@ Future<void> _showMyOptionsSheet(
"Proceeding will forfeit your bonus points for this session.",
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.rewardAmber,
fontFamily: FontConstants.fontFamily,
height: 1.3,

View File

@@ -270,6 +270,30 @@ extension StopKindUi on StopKind {
StopKind.combined => 'PICKUP & DELIVERY',
};
/// One or two characters, for a rail row that has no room for a word.
///
/// ── Why not [badgeLabel] at a smaller size ──
///
/// The route's rail is a column of orders, and the thing the rider is asking
/// as he runs down it is "which of these am I collecting and which am I
/// handing over". `PICKUP & DELIVERY` set small enough to fit beside the
/// chevron is a word he has to *read*; `P&D` is a mark he recognises. At one
/// per row, down a list, the difference is the whole point of putting it
/// there.
///
/// A line with one kind of work all day takes the first letter of its own
/// name, so a milk round reads `D` rather than borrowing the parcel line's
/// vocabulary — see [ServiceProfile.workTypeLabel].
String get shortLabel {
final single = ServiceProfile.active.workTypeLabel;
if (single != null && single.isNotEmpty) return single[0].toUpperCase();
return switch (this) {
StopKind.pickup => 'P',
StopKind.delivery => 'D',
StopKind.combined => 'P&D',
};
}
/// Sentence-case name of the mode, for places that state it as a *label*
/// rather than stamp it as a chip — see the handoff screen's next-stop block.
///

View File

@@ -9,6 +9,7 @@ import 'package:image_picker/image_picker.dart';
import 'package:miler/data/service_profile.dart';
import 'package:miler/views/Dashboard/pickups/stop_type.dart';
import 'package:miler/views/helpers/constants/Colorconstants.dart';
import 'package:miler/views/helpers/constants/miler_surface.dart';
import 'package:miler/views/helpers/constants/design_constants.dart';
import 'package:miler/views/helpers/constants/miler_type.dart';
import 'package:miler/views/helpers/constants/Font_constant.dart';
@@ -445,7 +446,14 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
// which on this screen is the difference between an address on two lines
// and an address on three.
child: Scaffold(
backgroundColor: ColorConstants.daylightSurface,
// ── The canvas, not the old slate ──
//
// This was `daylightSurface` — #DEE3EA, the heavy grey the whole app
// used to sit on. The ground moved to a near-white canvas when cards
// took on a hairline and a lift (see [Narrative]); these screens kept
// the old value, so the flow a rider spends the most time in was the
// one place still showing dark bars between its sections.
backgroundColor: MilerSurface.canvas,
// ── The bar breathes, and its title is a title ──
//
// 17sp jammed against the status bar is a system default, not a
@@ -600,7 +608,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'${idx + 1}',
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: current
? Colors.white
: ColorConstants.secondaryText,
@@ -620,7 +628,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
style: TextStyle(
fontSize: 10.5.sp,
height: 1.2,
fontWeight: current ? FontWeight.w700 : FontWeight.w500,
fontWeight: current ? FontWeight.w800 : FontWeight.w600,
color: past
? ColorConstants.acceptGreen
: current
@@ -687,7 +695,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: _kind.accent,
fontFamily: FontConstants.fontFamily,
),
@@ -703,7 +711,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.acceptGreen,
fontFamily: FontConstants.fontFamily,
),
@@ -718,7 +726,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 19.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.5,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -811,7 +819,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: accent,
fontFamily: FontConstants.fontFamily,
),
@@ -859,17 +867,14 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_choiceGrid(
count: _Recipient.values.length,
chips: (width, lastWidth) => [
for (final (i, r) in _Recipient.values.indexed)
chips: (width) => [
for (final r in _Recipient.values)
_choiceChip(
label: r.label,
icon: r.icon,
selected: _recipient == r,
accent: ColorConstants.deliveryAccent,
width: i == _Recipient.values.length - 1
? lastWidth
: width,
width: width,
onTap: () => setState(() => _recipient = r),
),
],
@@ -955,7 +960,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -974,7 +979,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: ColorConstants.acceptGreen,
fontFamily: FontConstants.fontFamily,
),
@@ -1020,15 +1025,14 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
done: !_condition.needsNote,
icon: LucideIcons.badgeCheck,
child: _choiceGrid(
count: _Condition.values.length,
chips: (width, lastWidth) => [
for (final (i, c) in _Condition.values.indexed)
chips: (width) => [
for (final c in _Condition.values)
_choiceChip(
label: c.label,
icon: c.icon,
selected: _condition == c,
accent: c.accent,
width: i == _Condition.values.length - 1 ? lastWidth : width,
width: width,
onTap: () => setState(() => _condition = c),
),
],
@@ -1149,7 +1153,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'$_collected',
style: TextStyle(
fontSize: 30.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -1,
height: 1.1,
color: ColorConstants.slateText,
@@ -1160,7 +1164,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'of $_expectedPickup booked',
style: TextStyle(
fontSize: 11.5.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1223,7 +1227,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
: 'Something is missing',
style: TextStyle(
fontSize: 19.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.5,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -1241,7 +1245,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
style: TextStyle(
fontSize: 13.5.sp,
height: 1.4,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1375,7 +1379,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 11.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.8,
color: accent,
fontFamily: FontConstants.fontFamily,
@@ -1419,7 +1423,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
done ? 'Complete' : 'Unfinished',
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.2,
color: color,
fontFamily: FontConstants.fontFamily,
@@ -1469,7 +1473,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'No proof photo — go back and take one',
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.warning,
fontFamily: FontConstants.fontFamily,
),
@@ -1524,7 +1528,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'Tap to enlarge',
style: TextStyle(
fontSize: 10.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: Colors.white,
fontFamily: FontConstants.fontFamily,
),
@@ -1649,7 +1653,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 11.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1665,7 +1669,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
style: TextStyle(
fontSize: 15.sp,
height: 1.25,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: fact.mono ? 1.2 : -0.3,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
@@ -1715,7 +1719,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1810,7 +1814,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -1943,7 +1947,6 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
// used to close with. See [MilerBand].
child: MilerBand(
color: done ? _doneFill : ColorConstants.pureSurface,
rail: done ? ColorConstants.acceptGreen : null,
padding: EdgeInsets.fromLTRB(_bandPad, 15.h, _bandPad, 17.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -1981,7 +1984,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
title,
style: MilerType.body.copyWith(
fontSize: 15.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: -0.25,
),
),
@@ -2022,7 +2025,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'Optional',
style: TextStyle(
fontSize: 11.sp,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -2052,7 +2055,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'Required',
style: TextStyle(
fontSize: 9.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
letterSpacing: 0.3,
color: ColorConstants.warning,
fontFamily: FontConstants.fontFamily,
@@ -2078,20 +2081,22 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
/// two-up grid leaves the third at half width on a line of its own, which
/// looks like the grid ran out rather than like a row. The last one takes the
/// full width instead, and the block reads as two deliberate rows.
Widget _choiceGrid({
required int count,
required List<Widget> Function(double width, double lastWidth) chips,
}) {
Widget _choiceGrid({required List<Widget> Function(double width) chips}) {
return LayoutBuilder(
builder: (context, constraints) {
const gap = 9.0;
final full = constraints.maxWidth;
final half = (full - gap) / 2;
return Wrap(
spacing: gap,
runSpacing: gap,
children: chips(half, count.isOdd ? full : half),
);
// ── An odd last option keeps its column ──
//
// It used to stretch to the full width, and with three options that put
// the biggest target on the screen under `Damaged` — the rarest choice
// and the one with the worst consequence, drawn twice the size of
// `Sealed & intact`. Size is emphasis, and this set has no reason to
// emphasise its exception.
//
// A grid with an empty cell in the last row is what a grid looks like.
return Wrap(spacing: gap, runSpacing: gap, children: chips(half));
},
);
}
@@ -2121,7 +2126,22 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
constraints: BoxConstraints(minHeight: 52.h),
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
color: selected ? accent : ColorConstants.pureSurface,
// ── Selection is a tint and an edge, not a slab ──
//
// The chosen option was painted in the accent at full strength with
// white type on it. At 52pt tall and half the page wide that is not
// a selected option, it is a filled button — the heaviest object on
// a screen whose actual button is at the foot of it, and on a
// finished section it put a block of solid green inside a card that
// was already green.
//
// The accent at a tenth, under an edge of the accent itself, with
// the label in it. It is the treatment the payment tiles and the
// service chips in this same flow already use, so a rider learns
// "chosen looks like this" once.
color: selected
? ColorConstants.tint(accent, 0.10)
: ColorConstants.pureSurface,
borderRadius: BorderRadius.circular(DesignConstants.radiusLg),
// An edge at rest. On the old grey panel a white chip separated
// itself by fill alone; on a white page it has nothing to separate
@@ -2129,7 +2149,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
// option the rider does not know he can press.
border: Border.all(
color: selected ? accent : ColorConstants.borderStrong,
width: 1.4,
width: selected ? 1.6 : 1.4,
),
),
child: Row(
@@ -2145,7 +2165,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
Icon(
icon,
size: 16.sp,
color: selected ? Colors.white : ColorConstants.secondaryText,
color: selected ? accent : ColorConstants.secondaryText,
),
SizedBox(width: 7.w),
// Flexible, not a bare Text. A [Wrap] hands every chip the full page
@@ -2161,8 +2181,8 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13.sp,
fontWeight: FontWeight.w600,
color: selected ? Colors.white : ColorConstants.slateText,
fontWeight: selected ? FontWeight.w800 : FontWeight.w700,
color: selected ? accent : ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
);
@@ -2195,7 +2215,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
onChanged: (_) => setState(() {}),
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.slateText,
fontFamily: FontConstants.fontFamily,
),
@@ -2203,7 +2223,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
hintText: hint,
hintStyle: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w500,
fontWeight: FontWeight.w600,
color: ColorConstants.secondaryText,
fontFamily: FontConstants.fontFamily,
),
@@ -2213,7 +2233,17 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
color: ColorConstants.secondaryText,
),
filled: true,
fillColor: ColorConstants.pureSurface,
// ── A field on a white card needs a ground of its own ──
//
// This was `pureSurface` — white type on white inside a white card,
// separated from it by a hairline alone. It read as a line drawn on the
// card rather than as somewhere to type, and at arm's length in sun the
// hairline is the first thing to go.
//
// The canvas is the app's own "one step back from a surface" tone, so a
// field wearing it sits *in* the card the way a well does, and the
// hairline becomes the edge of a shape rather than the whole of it.
fillColor: MilerSurface.canvas,
contentPadding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 13.h),
// Outlined at rest, with the accent spent on the field the cursor is
// in. This was borderless, which worked while the fill sat on a grey
@@ -2313,7 +2343,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
'Take photo',
style: TextStyle(
fontSize: 13.5.sp,
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
color: accent,
fontFamily: FontConstants.fontFamily,
),
@@ -2330,10 +2360,12 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
margin: EdgeInsets.symmetric(horizontal: _bandPad),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 11.h),
decoration: BoxDecoration(
// Tinted *onto the card it sits on*. Mixed against the old page slate
// it came out darker than its own surface, which reads as a hole.
color: ColorConstants.tint(
accent,
0.10,
on: ColorConstants.daylightSurface,
on: ColorConstants.pureSurface,
),
borderRadius: BorderRadius.circular(DesignConstants.radiusLg),
),
@@ -2347,7 +2379,7 @@ class _StopVerificationPageState extends State<StopVerificationPage> {
style: TextStyle(
fontSize: 12.sp,
height: 1.35,
fontWeight: FontWeight.w600,
fontWeight: FontWeight.w700,
color: accent,
fontFamily: FontConstants.fontFamily,
),