feat: New Open Tab dialog with search and optional customer email. Drinks are now grouped per order. Payments trigger cha-ching and money rain.

This commit is contained in:
2026-10-28 02:11:32 +01:00
parent 1aee0541c4
commit 29ceb51177
41 changed files with 2771 additions and 812 deletions
+77
View File
@@ -0,0 +1,77 @@
import 'package:flutter/material.dart';
import '../../l10n/app_localizations.dart';
import '../../utils/money.dart';
import '../../utils/tab_orders.dart';
/// The line above the drinks of one order: "—— 12:32 today ——". With
/// [totalInCents] it adds what the order costs; with [onTap] it opens and
/// closes the order, a chevron showing whether it is [expanded].
class OrderDivider extends StatelessWidget {
final DateTime startedAt;
final int? totalInCents;
final bool expanded;
final VoidCallback? onTap;
const OrderDivider({
super.key,
required this.startedAt,
this.totalInCents,
this.expanded = true,
this.onTap,
});
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
final locale = Localizations.localeOf(context).toLanguageTag();
final scheme = Theme.of(context).colorScheme;
final line = Expanded(
child: Divider(color: scheme.onSurface.withValues(alpha: 0.18)),
);
final label = [
orderTimeLabel(l10n, locale, startedAt),
if (totalInCents != null) totalInCents!.asEuro,
].join(' – ');
final style = Theme.of(context).textTheme.bodySmall?.copyWith(
fontWeight: FontWeight.w700,
color: scheme.onSurface.withValues(alpha: 0.6),
);
final row = Padding(
padding: const EdgeInsets.only(top: 6, bottom: 2),
child: Row(
children: [
line,
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(label, style: style),
if (onTap != null) ...[
const SizedBox(width: 2),
Icon(
expanded
? Icons.keyboard_arrow_up_rounded
: Icons.keyboard_arrow_down_rounded,
size: 18,
color: style?.color,
),
],
],
),
),
line,
],
),
);
if (onTap == null) return row;
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(8),
child: row,
);
}
}