feat: display POS name in order cards on the orders screen

This commit is contained in:
Suherdy Yacob 2026-06-14 16:31:03 +07:00
parent 4e6ce85953
commit 3bd6eb83ac

View File

@ -119,6 +119,7 @@ class _OrdersScreenState extends State<OrdersScreen> {
final isEarn = item['type'] == 'earn'; final isEarn = item['type'] == 'earn';
final orderRef = item['order_ref'] as String? ?? ''; final orderRef = item['order_ref'] as String? ?? '';
final rawDate = item['date'] as String? ?? ''; final rawDate = item['date'] as String? ?? '';
final posName = item['pos_name'] as String? ?? '';
return Card( return Card(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6), margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
@ -146,12 +147,37 @@ class _OrdersScreenState extends State<OrdersScreen> {
), ),
subtitle: Padding( subtitle: Padding(
padding: const EdgeInsets.only(top: 6.0), padding: const EdgeInsets.only(top: 6.0),
child: Text( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (posName.isNotEmpty) ...[
Row(
children: [
Icon(
Icons.storefront_rounded,
size: 14,
color: theme.colorScheme.primary,
),
const SizedBox(width: 4),
Text(
posName,
style: theme.textTheme.bodySmall?.copyWith(
fontWeight: FontWeight.w600,
color: theme.colorScheme.primary,
),
),
],
),
const SizedBox(height: 4),
],
Text(
_formatDate(rawDate), _formatDate(rawDate),
style: theme.textTheme.bodySmall?.copyWith( style: theme.textTheme.bodySmall?.copyWith(
color: AppTheme.onSurfaceVariant, color: AppTheme.onSurfaceVariant,
), ),
), ),
],
),
), ),
trailing: Text( trailing: Text(
'${isEarn ? '+' : ''}${item['points']} pts', '${isEarn ? '+' : ''}${item['points']} pts',