srs/lib/features/orders/order_card.dart
Aswin Biju 749d18192a
All checks were successful
deploy / deploy (push) Successful in 4m58s
refactor: updated UI and other trivial fixes
2026-11-05 10:13:32 +05:30

82 lines
2.5 KiB
Dart

import 'package:flutter/material.dart';
import '../../core/format.dart';
import '../../core/models.dart';
import '../../core/theme.dart';
import '../../widgets/ui.dart';
class OrderCard extends StatelessWidget {
const OrderCard({super.key, required this.order, required this.onTap});
final Order order;
final VoidCallback onTap;
@override
Widget build(BuildContext context) {
final o = order;
return SrsCard(
onTap: onTap,
padding: const EdgeInsets.all(S.s14),
child: Row(
children: [
CodeTile(o.shop.code),
const SizedBox(width: S.s14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Flexible(
child: Text(
o.shop.name,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: ts(15, w: w6),
),
),
if (o.edited) ...[
const SizedBox(width: S.s8),
const Pill('Edited', bg: C.goldTint, fg: C.goldText),
],
],
),
const SizedBox(height: S.s4),
Row(
children: [
Icon(
o.isPhoto
? Icons.photo_camera_outlined
: Icons.chat_bubble_outline_rounded,
size: 13,
color: C.muted,
),
const SizedBox(width: S.s6),
Flexible(
child: Text(
'${o.shop.code} · ${time12(o.time)} · ${o.kind}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: ts(12, c: C.muted),
),
),
],
),
],
),
),
const SizedBox(width: S.s8),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(inr(o.tickets), style: ts(18, w: w7)),
Text('tickets', style: ts(11, c: C.muted)),
],
),
const SizedBox(width: S.s4),
const Icon(Icons.chevron_right_rounded, color: C.placeholder),
],
),
);
}
}