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

@@ -87,27 +87,27 @@ void main() {
expect(stopSourceName({'kitchenname': 'Kitchen 1'}), 'Kitchen 1');
expect(stopSourceName({'SourceName': ' Anna Nagar '}), 'Anna Nagar');
expect(stopSourceId({'kitchenid': 'K-77'}), 'K-77');
expect(stopBagLabel({'baglabel': 'DG-1042'}), 'DG-1042');
expect(stopBagLabel({'labelcode': 'DG-9'}), 'DG-9');
expect(stopPrintedLabel({'baglabel': 'DG-1042'}), 'DG-1042');
expect(stopPrintedLabel({'labelcode': 'DG-9'}), 'DG-9');
});
test(
'absent on a parcel stop rather than empty-stringed onto the card',
() {
expect(stopSourceName({'orderid': '7'}), '');
expect(stopBagLabel({'orderid': '7'}), '');
expect(stopPrintedLabel({'orderid': '7'}), '');
},
);
});
group('StopSourceLine', () {
Future<void> pump(WidgetTester tester, String source, String bag) async {
Future<void> pump(WidgetTester tester, String source, String label) async {
await tester.pumpWidget(
ScreenUtilInit(
designSize: const Size(390, 844),
builder: (_, _) => MaterialApp(
home: Scaffold(
body: StopSourceLine(source: source, bagLabel: bag),
body: StopSourceLine(source: source, printedLabel: label),
),
),
),
@@ -126,12 +126,17 @@ void main() {
testWidgets('shows both when the stop carries both', (tester) async {
await pump(tester, 'Kitchen 1', 'DG-1042');
expect(find.text('Kitchen 1'), findsOneWidget);
expect(find.text('Bag DG-1042'), findsOneWidget);
// The counter's code, exactly as it was sent. It used to be prefixed
// `Bag DG-1042` — a word bolted onto a reference that already names
// itself.
expect(find.text('DG-1042'), findsOneWidget);
});
testWidgets('shows the bag alone when there is no source', (tester) async {
testWidgets('shows the label alone when there is no source', (
tester,
) async {
await pump(tester, '', 'DG-1042');
expect(find.text('Bag DG-1042'), findsOneWidget);
expect(find.text('DG-1042'), findsOneWidget);
expect(
tester.getSize(find.byType(StopSourceLine)).height,
greaterThan(0),
@@ -206,12 +211,12 @@ void main() {
// Named once, by the place — not again on every order under it.
expect(find.text('Kitchen 1'), findsOneWidget);
// The label the kitchen printed, straight from [BagManifest]. The `Bag `
// The label the kitchen printed, straight from [OrderManifest]. The `Bag `
// prefix belonged to the card's chip and went with it, which stopped a
// printed `DG-1042` reading as `Bag DG-1042`.
expect(find.text('DG-1042'), findsOneWidget);
// The count the rider checks the shelf against.
expect(find.text('1 bag'), findsOneWidget);
expect(find.text('1 order'), findsOneWidget);
});
testWidgets('a parcel route keeps a bare pending row', (tester) async {