Files
doormile_customer_app/test/page_transition_test.dart
Thiru-tenext 49b0de0d8f Pages fall away downward, the pickup comes back, and a real icon set
── Navigation ──

Pages arrived from the right and left to the right. Right is the direction
the system back gesture drags, so a page leaving under a button press read as
a swipe nobody made — and every push in this app is a layer over the one
before it, which arrives from below. The axis is vertical now: the incoming
page rises and covers, the page underneath stays put and dims, and back drops
the top page off the bottom. Full travel rather than the old 14% nudge, which
is what makes the direction nameable. test/page_transition_test.dart holds it.

── Home ──

The pickup pill is back under the greeting. It was cut on the argument that
the form below already carried the pickup; the form is four hundred points
down the screen, and a location you can only see by scrolling to a form is a
location you do not trust. It shows the locality while the form keeps the
door, so the screen answers one question once, and it now has a resolving
state — it used to print the last place you were, confidently, while the fix
was still in flight.

The sphere's caption was falling off the screen. Adding the pill pushed it out
of the scroll viewport, silently, with no overflow warning — the fourth time
Home growing has clipped something under the sphere. DmBookOrb.field is no
longer a constant: the glow gives way to whatever is left, the sphere never
does.

── 74 points of dead canvas, on every root ──

Home, Orders and Account each cleared the floating tab bar by
`MediaQuery.paddingOf(context).bottom + 74`, on the reasoning that the inset is
the home indicator and 74 is the bar above it. Scaffold with extendBody
replaces the body's bottom padding with the bar's whole laid-out height —
measured, a 34pt inset and this bar hand the body 106. They were clearing the
bar, then clearing it again. One helper now, dmTabBarClear().

── One journey, one vocabulary ──

Review said ORIGIN/DESTINATION; Home's form and tracking say PICKUP/DROP.
Three screens a customer walks in order. The tracking card had already written
down the argument; the booking screen hadn't followed.

The rail's first milestone read "Booking created" directly above "Order
created" — down the rail: created, created, in transit. It is "Pickup booked",
which is what JourneyStage.milestoneLabel has called that stage all along on
Orders and on Home's live row.

── The launcher icon ──

tool/icons.py renders all twenty-eight files from one master, because the
failure mode of exporting by hand is nineteen replaced and nine left on the
old mark, at the density nobody checks.

The master is a bare mark on a field, so it cannot be dropped into Android's
adaptive canvas whole: crimson is the background, the white mark is the
foreground, and it is sized by its reach from the canvas centre so a round
mask cannot take the arrow tip. Measured on the built file: 63.7dp against a
66dp safe zone. A real monochrome layer replaces the colour foreground that
was standing in for one — the system tints by alpha, so that themed as a blob.
ic_launcher_round.png exists at last; minSdk is 24 and android:roundIcon had
nothing to resolve to below API 26.

The artwork is flattened (the source vignettes over ten values of red) and its
horizontal offset is placed deliberately rather than inherited — geometric
centring made the mark lean, because the arrow carries the bounding box right
while contributing almost none of the ink.

── Bundle ──

pubspec declared assets/images/ as a folder, which shipped the 974 KB icon
master to every customer for a file no code opens. Named explicitly now.
2026-09-25 13:34:52 +05:30

140 lines
4.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:doormile_cx/main.dart';
import 'package:doormile_cx/ui/screens/booking/booking_routes.dart';
/// ─────────────────────────────────────────────────────────────────────────
/// WHICH WAY A PAGE LEAVES
///
/// The app's pages used to arrive from the right and leave to the right, which
/// is the direction the system back gesture drags — a page that slides off
/// sideways under a button press reads as a swipe the customer did not make.
///
/// They now rise from the bottom and fall back down it. A golden cannot see
/// motion, so this is where that direction is held: mid-push the incoming page
/// is *below* where it lands and exactly on its horizontal mark, and mid-pop it
/// is on its way back down rather than off to one side.
/// ─────────────────────────────────────────────────────────────────────────
void main() {
const key = ValueKey('pushed-page');
Future<void> pumpApp(WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
theme: buildDoormileTheme(),
home: Builder(
builder: (context) => Scaffold(
body: Center(
child: TextButton(
onPressed: () => Navigator.of(context).push(
bookingRoute<void>(
'x',
(_) => const Scaffold(
key: key,
body: Center(child: Text('second')),
),
),
),
child: const Text('go'),
),
),
),
),
),
);
}
/// Where the pushed page's top-left corner currently sits.
Offset cornerOf(WidgetTester tester) =>
tester.getTopLeft(find.byKey(key).first);
testWidgets('a push arrives from below, not from the side', (tester) async {
await pumpApp(tester);
final screen = tester.view.physicalSize / tester.view.devicePixelRatio;
await tester.tap(find.text('go'));
await tester.pump();
// Partway through the 420ms push.
await tester.pump(const Duration(milliseconds: 120));
final corner = cornerOf(tester);
expect(
corner.dy,
greaterThan(0),
reason: 'the arriving page should still be below its resting place',
);
expect(
corner.dy,
lessThan(screen.height),
reason: 'and already on screen, not still parked off the bottom',
);
expect(
corner.dx,
0,
reason: 'nothing travels horizontally any more',
);
await tester.pumpAndSettle();
expect(cornerOf(tester), Offset.zero);
});
testWidgets('back drops the page down the screen', (tester) async {
await pumpApp(tester);
await tester.tap(find.text('go'));
await tester.pumpAndSettle();
final settled = cornerOf(tester);
expect(settled, Offset.zero);
// The back button, not a gesture.
final popped = tester.state<NavigatorState>(find.byType(Navigator));
popped.pop();
await tester.pump();
await tester.pump(const Duration(milliseconds: 120));
final leaving = cornerOf(tester);
expect(
leaving.dy,
greaterThan(0),
reason: 'the page being left should be heading down, not up',
);
expect(
leaving.dx,
0,
reason: 'and not sideways, which is what it used to do',
);
});
testWidgets('it travels the whole height, so the direction is readable', (
tester,
) async {
await pumpApp(tester);
final screen = tester.view.physicalSize / tester.view.devicePixelRatio;
await tester.tap(find.text('go'));
await tester.pump();
// One frame in: the page has barely moved, so it is still near the bottom
// edge. A 14%-of-the-width nudge — what this replaced — would put it within
// a few points of its resting place by now.
await tester.pump(const Duration(milliseconds: 16));
expect(
cornerOf(tester).dy,
greaterThan(screen.height * 0.5),
reason: 'a token nudge has no direction a customer can name',
);
});
testWidgets('going back is quicker than going forward', (tester) async {
final route = bookingRoute<void>('x', (_) => const SizedBox()) as DmPageRoute;
expect(route.transitionDuration, const Duration(milliseconds: 420));
expect(route.reverseTransitionDuration, const Duration(milliseconds: 340));
expect(
route.reverseTransitionDuration < route.transitionDuration,
isTrue,
reason: 'the customer already knows what is behind them',
);
});
}