Offline sync: indikator status sinkron di Riwayat + retry antrean otomatis

This commit is contained in:
Onie
2026-10-18 20:21:40 +07:00
parent e557a82faa
commit 903eb9fc42
4 changed files with 66 additions and 6 deletions

View File

@@ -469,6 +469,28 @@ class _RiwayatScreenState extends State<RiwayatScreen> {
),
),
],
if (state.isSalePending(sale.id)) ...[
const SizedBox(height: 2),
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
Icons.hourglass_empty,
size: 10,
color: kMuted,
),
const SizedBox(width: 4),
Text(
'Menunggu sinkron',
style: const TextStyle(
fontSize: 10,
color: kMuted,
fontWeight: FontWeight.w600,
),
),
],
),
],
],
),
),
@@ -633,6 +655,8 @@ class _RiwayatScreenState extends State<RiwayatScreen> {
_receiptRow('Kembali', formatRupiah(currentSale.change.clamp(0, double.infinity)), false),
_receiptRow('Metode', _paymentMethodLabel(currentSale.paymentMethod), false),
_receiptRow('Status', currentSale.paymentStatus == 'paid' ? 'Lunas' : 'Belum Lunas', false),
if (state.isSalePending(currentSale.id))
_receiptRow('Sinkronisasi', 'Belum terkirim ke server', false),
if (currentSale.splitPayment != null && currentSale.splitPayment!.isNotEmpty)
...currentSale.splitPayment!.entries.map((e) {
final label = e.key == 'tunai'