Redesign: Poppins, a two-step destination, and a splash that says what the app does
The effort pass, end to end. Every screen was run through one test — if I remove this sentence, does the customer make a worse decision? — and the parts that failed it are gone. The flow Home ▸ BOOK ▸ Where is it going? ▸ When shall we collect? ▸ details ▸ booked BOOK opens a sheet, not a form. The destination is browsed state-then-district because a flat list of every serviceable district survives twelve and not sixty, and search cuts across states because somebody who knows they are sending to Chennai should not have to know which state it is in. Districts multi-select, but only where the server allows it: BookingLimits advertises maxDestinations: 1 until the Miler build keys on consignmentid, and a sheet that ignored that would sell a booking the network cannot complete. The pickup window is now a step the customer answers rather than a slot chosen for them. A pickup window is a promise about somebody's afternoon. What the screens stopped saying Home lost the orb caption for returning customers and a four-cell live card. Send lost the city strip, both address fields, the optional disclosure and three sentences about charging — the route, the packages and the button are what is left. Tracking lost a radar with a bike in it, a Milers-in-your-zone count, a "Step 2 of 7" and a sentence describing the screen you were looking at. The window sheet lost "Fastest pickup", "4 Milers nearby" and "Relaxed evening handover". Type Poppins, which has no variable release — four static cuts, and the sans styles set fontWeight alone because fontVariations on a static font is ignored in silence. Every weight dropped a step and the tracking went deeper: Poppins is built on near-circles and carries more ink than the humanist faces before it. Objects One lit sphere on Home, and the primary button now takes its gradient and rim because a committing action that is not lit like the hero reads as a different material. The tracking rail's connector is crimson as far as the parcel has come, so the line is the progress bar. Confirmation is a white tick on green: crimson is this app's action colour and that screen has nothing left to do. Bugs found on the way The OTP screen dropped digits. Four fields passing focus along lose a keystroke that arrives mid-transition, so "1234" became "124" and the screen answered "That code did not match" — blaming the customer for its own race. One field now, four boxes that only draw. Nothing ever asked for the customer's location: detectPickupLocation was the OTP screen's job, so a restored session or an auto-login never triggered the permission prompt and the pickup map had nothing to centre on. The launcher icon and both splash screens pointed at a house drawn as two vector paths — a placeholder that shipped. The splash clock started when the widget was built rather than when it was visible, so the truck got 0.45s of a 1.8s beat behind Android's own splash. It waits on waitUntilFirstFrameRasterized now, raced against a timeout so a binding that never reports one cannot strand the app. Also: design/screens/ holds all 19 screens under readable names, tool/ has the scripts that refresh them and rebrand the Lottie, and DESIGN.md is current. flutter analyze clean. 88 tests, 1 skipped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EqVJPB9B4QuieZnBAAKgYQ
This commit is contained in:
@@ -81,79 +81,122 @@ class TrackingScreen extends StatelessWidget {
|
||||
style: DmText.mono,
|
||||
),
|
||||
),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
children: [
|
||||
_StatusHeader(booking: booking, slot: slot, focused: focused),
|
||||
body: RefreshIndicator(
|
||||
color: DmColors.brand,
|
||||
backgroundColor: DmColors.surface,
|
||||
onRefresh: () => app.refreshBooking(booking.reference),
|
||||
child: ListView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
children: [
|
||||
_StatusHeader(booking: booking, slot: slot, focused: focused),
|
||||
|
||||
if (assigning)
|
||||
const _AssigningHero()
|
||||
else if (!cancelled)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
0,
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
// The map is a cell of a card, not a floating rounded rectangle
|
||||
// of its own: it gets the card's edge, and the line under it
|
||||
// carries the fact the picture cannot state precisely.
|
||||
child: DmCard(
|
||||
children: [
|
||||
DmRouteMap(
|
||||
height: 178,
|
||||
radius: 0,
|
||||
pickup: booking.pickup,
|
||||
destination: (focused ?? booking.destinations.first).hub,
|
||||
showMiler: milerEnRoute,
|
||||
progress: _routeProgress(stage),
|
||||
pickupLabel: booking.pickup.title,
|
||||
destinationLabel: booking.destination.districtName,
|
||||
badge: milerEnRoute && booking.milerDistanceKm != null
|
||||
? _Badge(
|
||||
icon: LucideIcons.bike,
|
||||
label: booking.milerDistanceKm == 0
|
||||
? 'At your door'
|
||||
: '${booking.miler?.name ?? 'Your Miler'}, '
|
||||
'${booking.milerDistanceKm} km away',
|
||||
)
|
||||
: null,
|
||||
),
|
||||
DmCardCell(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 10, 12),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(
|
||||
LucideIcons.clock,
|
||||
size: 15,
|
||||
color: DmColors.ink3,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
// Short enough to sit beside Refresh without
|
||||
// ellipsizing, which is the whole job of this line.
|
||||
milerEnRoute && booking.milerEtaMinutes != null
|
||||
? 'Pickup in about ${booking.milerEtaMinutes} min'
|
||||
: 'Tracking your parcel live',
|
||||
style: DmText.small,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
DmTextAction(
|
||||
label: 'Refresh',
|
||||
onPressed: app.refreshOrders,
|
||||
),
|
||||
],
|
||||
// ── No radar while a Miler is being found ──
|
||||
//
|
||||
// This showed a 200pt card holding a pulsing radar with a bike
|
||||
// glyph at its centre, then a banner counting "verified Milers
|
||||
// active in your zone". Both were animation standing in for an
|
||||
// answer: the radar is not looking at anything, and the count is a
|
||||
// number the customer cannot use. The rail below says *Booking
|
||||
// created* with the line stopped there, and the crimson card above
|
||||
// says what is happening in words. That is the answer, and it is
|
||||
// the same rail whether a Miler has been found or not.
|
||||
if (!assigning && !cancelled)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
0,
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
// The map is a cell of a card, not a floating rounded rectangle
|
||||
// of its own: it gets the card's edge, and the line under it
|
||||
// carries the fact the picture cannot state precisely.
|
||||
child: DmCard(
|
||||
children: [
|
||||
DmRouteMap(
|
||||
height: 178,
|
||||
radius: 0,
|
||||
pickup: booking.pickup,
|
||||
destination: (focused ?? booking.destinations.first).hub,
|
||||
showMiler: milerEnRoute,
|
||||
progress: _routeProgress(stage),
|
||||
pickupLabel: booking.pickup.title,
|
||||
destinationLabel: booking.destination.districtName,
|
||||
badge: milerEnRoute && booking.milerDistanceKm != null
|
||||
? _Badge(
|
||||
icon: LucideIcons.bike,
|
||||
label: booking.milerDistanceKm == 0
|
||||
? 'At your door'
|
||||
: '${booking.miler?.name ?? 'Your Miler'}, '
|
||||
'${booking.milerDistanceKm} km away',
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
// Only when there is something to say. This cell used to
|
||||
// read "Tracking your parcel live" whenever no ETA existed,
|
||||
// beside a Refresh action — a sentence that described the
|
||||
// screen the customer was already looking at, and a button
|
||||
// for a gesture the list now handles by being pulled down.
|
||||
if (milerEnRoute && booking.milerEtaMinutes != null)
|
||||
DmCardCell(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(
|
||||
LucideIcons.clock,
|
||||
size: 15,
|
||||
color: DmColors.ink3,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Pickup in about '
|
||||
'${booking.milerEtaMinutes} min',
|
||||
style: DmText.cardTitle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
if (milerEnRoute)
|
||||
_MilerCard(person: booking.miler!, role: 'Your Miler'),
|
||||
if (!cancelled &&
|
||||
stage == JourneyStage.outForDelivery &&
|
||||
booking.deliveryAgent != null)
|
||||
_MilerCard(
|
||||
person: booking.deliveryAgent!,
|
||||
role: 'Delivery Miler',
|
||||
),
|
||||
|
||||
if (!cancelled)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
0,
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
child: _Journey(booking: booking),
|
||||
),
|
||||
|
||||
if (!cancelled && booking.hasOrders && booking.isMultiDestination)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
0,
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
child: _YourPackages(booking: booking, focused: focused),
|
||||
),
|
||||
),
|
||||
|
||||
if (assigning && booking.milersInZone > 0)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
@@ -161,57 +204,19 @@ class TrackingScreen extends StatelessWidget {
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
child: DmInfoBanner(
|
||||
icon: LucideIcons.users,
|
||||
title:
|
||||
'${booking.milersInZone} verified Milers active in your zone',
|
||||
message: 'Most pickups are accepted within a few minutes.',
|
||||
child: _RouteOutline(
|
||||
booking: booking,
|
||||
slot: slot,
|
||||
focused: focused,
|
||||
),
|
||||
),
|
||||
|
||||
if (milerEnRoute)
|
||||
_MilerCard(person: booking.miler!, role: 'Your Miler'),
|
||||
if (!cancelled &&
|
||||
stage == JourneyStage.outForDelivery &&
|
||||
booking.deliveryAgent != null)
|
||||
_MilerCard(person: booking.deliveryAgent!, role: 'Delivery Miler'),
|
||||
|
||||
if (!cancelled)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
0,
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
child: _Journey(booking: booking),
|
||||
),
|
||||
|
||||
if (!cancelled && booking.hasOrders && booking.isMultiDestination)
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
DmSpace.pad,
|
||||
0,
|
||||
DmSpace.pad,
|
||||
10,
|
||||
),
|
||||
child: _YourPackages(booking: booking, focused: focused),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(DmSpace.pad, 0, DmSpace.pad, 10),
|
||||
child: _RouteOutline(
|
||||
booking: booking,
|
||||
slot: slot,
|
||||
focused: focused,
|
||||
),
|
||||
),
|
||||
|
||||
// Stands in for backend push updates. Real stage changes arrive
|
||||
// from `GET /customer/bookings/{reference}`, so this exists only
|
||||
// where there is no server to send them.
|
||||
if (AppConfig.showStageStepper) _StageStepper(booking: booking),
|
||||
],
|
||||
// Stands in for backend push updates. Real stage changes arrive
|
||||
// from `GET /customer/bookings/{reference}`, so this exists only
|
||||
// where there is no server to send them.
|
||||
if (AppConfig.showStageStepper) _StageStepper(booking: booking),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: DmFooter(
|
||||
edge: true,
|
||||
@@ -233,7 +238,11 @@ class TrackingScreen extends StatelessWidget {
|
||||
/// full-width outlined button in the danger colour — the most prominent
|
||||
/// control on a screen whose job is to reassure someone that their parcel is
|
||||
/// fine.
|
||||
List<Widget> _footerActions(BuildContext context, AppState app, Booking booking) {
|
||||
List<Widget> _footerActions(
|
||||
BuildContext context,
|
||||
AppState app,
|
||||
Booking booking,
|
||||
) {
|
||||
if (booking.isCancelled || booking.stage == JourneyStage.delivered) {
|
||||
return [
|
||||
DmButton(
|
||||
@@ -384,7 +393,9 @@ class _StatusHeader extends StatelessWidget {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.right,
|
||||
style: DmText.small.copyWith(color: DmColors.onBrand3),
|
||||
style: DmText.small.copyWith(
|
||||
color: DmColors.onBrand3,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -392,25 +403,35 @@ class _StatusHeader extends StatelessWidget {
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
headline,
|
||||
style: DmText.display.copyWith(fontSize: 27, color: Colors.white),
|
||||
style: DmText.display.copyWith(
|
||||
fontSize: 27,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// The supporting sentence is gone. It restated the headline
|
||||
// — "Arun Kumar is assigned" over "Your Miler will arrive in
|
||||
// your pickup window" — and sat above a milestone label
|
||||
// saying "Miler assigned" and a counter saying "Step 2 of 7".
|
||||
// Four lines to answer a question the first one had answered.
|
||||
//
|
||||
// What is left is the one fact the headline does not carry:
|
||||
// when. It is set at heading size because after "what is
|
||||
// happening" it is the only thing the customer came for.
|
||||
const SizedBox(height: 14),
|
||||
Text(
|
||||
_footnote(stage),
|
||||
style: DmText.heading.copyWith(
|
||||
fontSize: 17,
|
||||
color: DmColors.onBrand2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(sub, style: DmText.small.copyWith(color: DmColors.onBrand2)),
|
||||
const SizedBox(height: 16),
|
||||
DmStepBar(
|
||||
progress: step / total,
|
||||
steps: total,
|
||||
current: step,
|
||||
onFill: true,
|
||||
// The milestone, not the window: the window is already the
|
||||
// line underneath, and at this width it clipped to
|
||||
// "Window 2:00 – 4:…".
|
||||
label: CustomerMilestone.of(stage).label,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
_footnote(stage),
|
||||
style: DmText.tiny.copyWith(color: DmColors.onBrand3),
|
||||
caption: false,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -436,26 +457,23 @@ class _StatusHeader extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// The journey, compressed to what just happened.
|
||||
class _Journey extends StatefulWidget {
|
||||
/// The journey. All of it, always.
|
||||
///
|
||||
/// It used to show the three most recent milestones behind a "Full timeline"
|
||||
/// action, which was the right compression for seven and is the wrong one for
|
||||
/// five: the whole shipment now fits in the space the summary occupied, and a
|
||||
/// customer who opens tracking to ask "where is my parcel" should not have to
|
||||
/// tap to see the answer's context.
|
||||
class _Journey extends StatelessWidget {
|
||||
const _Journey({required this.booking});
|
||||
|
||||
final Booking booking;
|
||||
|
||||
@override
|
||||
State<_Journey> createState() => _JourneyState();
|
||||
}
|
||||
|
||||
class _JourneyState extends State<_Journey> {
|
||||
bool _all = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DmMilestones(
|
||||
booking: widget.booking,
|
||||
title: widget.booking.trackingId == null ? 'Recent updates' : 'Live journey',
|
||||
maxRows: _all ? null : 3,
|
||||
onExpand: () => setState(() => _all = true),
|
||||
booking: booking,
|
||||
title: booking.trackingId == null ? 'Journey' : 'Live journey',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -497,42 +515,6 @@ class _Badge extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// Radar shown while the backend matches a Miler.
|
||||
class _AssigningHero extends StatelessWidget {
|
||||
const _AssigningHero();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(DmSpace.pad, 0, DmSpace.pad, 20),
|
||||
child: Container(
|
||||
height: 200,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: DmColors.surface,
|
||||
border: Border.all(color: DmColors.border),
|
||||
borderRadius: DmRadius.all(DmRadius.md),
|
||||
),
|
||||
child: DmRadarPulse(
|
||||
size: 170,
|
||||
child: Container(
|
||||
width: 62,
|
||||
height: 62,
|
||||
decoration: const BoxDecoration(
|
||||
color: DmColors.brand,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: const Icon(
|
||||
LucideIcons.bike,
|
||||
size: 28,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Who is collecting, how good they are, and how to reach them.
|
||||
///
|
||||
/// A wash rather than a plain card: this is the one row on the screen about a
|
||||
@@ -608,7 +590,8 @@ class _MilerCard extends StatelessWidget {
|
||||
label: 'Call',
|
||||
icon: LucideIcons.phone,
|
||||
filled: true,
|
||||
onPressed: () => DmToast.show(context, 'Calling ${person.name}…'),
|
||||
onPressed: () =>
|
||||
DmToast.show(context, 'Calling ${person.name}…'),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
DmMiniButton(
|
||||
@@ -645,37 +628,37 @@ class _RouteOutline extends StatelessWidget {
|
||||
|
||||
return DmCard(
|
||||
children: [
|
||||
DmCardCell(
|
||||
child: DmRouteRail(
|
||||
pickup: booking.pickup.title,
|
||||
pickupNote: booking.pickup.sub,
|
||||
drop: group != null
|
||||
? group.destination.label
|
||||
: booking.isMultiDestination
|
||||
? '${booking.destinations.length} destinations'
|
||||
: booking.destination.label,
|
||||
dropNote: group != null
|
||||
? '${group.packageCount} '
|
||||
'${group.packageCount == 1 ? 'package' : 'packages'}'
|
||||
: booking.isMultiDestination
|
||||
? booking.packageSummary
|
||||
: booking.details.exactAddress ??
|
||||
(recipient == null
|
||||
? 'Exact address collected at pickup'
|
||||
: 'Recipient · $recipient'),
|
||||
),
|
||||
),
|
||||
DmSummaryRow(label: 'Pickup window', value: slot?.label ?? '—'),
|
||||
DmSummaryRow(
|
||||
label: (group?.trackingId ?? booking.trackingId) == null
|
||||
? 'Booking reference'
|
||||
: 'Tracking number',
|
||||
value: group?.trackingId ?? booking.displayId,
|
||||
mono: true,
|
||||
secondary: group == null
|
||||
? null
|
||||
: 'Collected together · Pickup ${booking.reference}',
|
||||
DmCardCell(
|
||||
child: DmRouteRail(
|
||||
pickup: booking.pickup.title,
|
||||
pickupNote: booking.pickup.sub,
|
||||
drop: group != null
|
||||
? group.destination.label
|
||||
: booking.isMultiDestination
|
||||
? '${booking.destinations.length} destinations'
|
||||
: booking.destination.label,
|
||||
dropNote: group != null
|
||||
? '${group.packageCount} '
|
||||
'${group.packageCount == 1 ? 'package' : 'packages'}'
|
||||
: booking.isMultiDestination
|
||||
? booking.packageSummary
|
||||
: booking.details.exactAddress ??
|
||||
(recipient == null
|
||||
? 'Exact address collected at pickup'
|
||||
: 'Recipient · $recipient'),
|
||||
),
|
||||
),
|
||||
DmSummaryRow(label: 'Pickup window', value: slot?.label ?? '—'),
|
||||
DmSummaryRow(
|
||||
label: (group?.trackingId ?? booking.trackingId) == null
|
||||
? 'Booking reference'
|
||||
: 'Tracking number',
|
||||
value: group?.trackingId ?? booking.displayId,
|
||||
mono: true,
|
||||
secondary: group == null
|
||||
? null
|
||||
: 'Collected together · Pickup ${booking.reference}',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -722,10 +705,7 @@ class _YourPackages extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
for (final group in booking.destinations)
|
||||
_PackageRow(
|
||||
group: group,
|
||||
isFocused: identical(group, focused),
|
||||
),
|
||||
_PackageRow(group: group, isFocused: identical(group, focused)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -760,7 +740,8 @@ class _PackageRow extends StatelessWidget {
|
||||
style: DmText.monoSm,
|
||||
),
|
||||
TextSpan(
|
||||
text: ' · ${group.packageCount} '
|
||||
text:
|
||||
' · ${group.packageCount} '
|
||||
'${group.packageCount == 1 ? 'package' : 'packages'}',
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user