device infos

This commit is contained in:
2026-08-28 15:07:30 +05:30
parent 5723d373b2
commit 69f4f3e909
84 changed files with 4337 additions and 2339 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:lucide_icons_flutter/lucide_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -99,11 +100,24 @@ void main() {
}
});
testWidgets('every Bag ends on one axis', (tester) async {
testWidgets('every order row ends on one axis', (tester) async {
// ── What this used to measure ──
//
// The right edge of `Bag 1 … Bag 4`, which was a tag the app derived from
// each row's position. That numbering is gone — it was the app's own
// arithmetic drawn as a physical reference, beside a rail already
// numbering the same rows — so the column it formed is gone with it.
//
// The rule it existed to protect is not: whatever closes a step row, the
// rows close together. A ragged right edge down a list of people is what
// makes a route unscannable, and it is now the chevrons that hold that
// edge.
await pumpHome(tester, orders: 4);
final rights = [
for (var i = 1; i <= 4; i++) tester.getRect(find.text('Bag $i')).right,
];
final rights = tester
.widgetList<Icon>(find.byIcon(LucideIcons.chevronRight))
.map((i) => tester.getRect(find.byWidget(i)).right)
.toList();
expect(rights.length, greaterThanOrEqualTo(4));
for (final r in rights) {
expect(r, closeTo(rights.first, 0.5));
}
@@ -117,27 +131,21 @@ void main() {
// This pinned the label to the *name* axis, when the control headed its
// list from the left. Inside a group it is a control over a list rather
// than a heading for one, so it sits on the edge a list's own controls
// use — the same right edge the bag labels and the chevrons below it
// already keep. What must not happen is that it floats between the two.
// use — the same right edge the chevrons below it already keep. What must
// not happen is that it floats between the two.
final label = tester.getRect(find.text('Select all 3')).right;
final list = tester.getRect(find.byType(RouteTimeline)).right;
final bag = tester.getRect(find.text('Bag 1')).right;
expect(
label,
closeTo(list, 4),
reason: 'the select-all ends at $label, the list at $list',
);
expect(
label,
greaterThan(bag),
reason: 'and it closes past the bag column rather than inside it',
);
});
testWidgets('the kitchen and its state share one axis', (tester) async {
await pumpHome(tester);
expect(
tester.getRect(find.text('Pending')).left,
tester.getRect(find.textContaining('Pending')).left,
closeTo(tester.getRect(find.text('Vidhya Kitchen')).left, 0.5),
);
});