- Wallet EnakPoint & EnakCoin: beranda, riwayat, saldo kedaluwarsa, kode bayar, tukar EnakCoin, transfer - PIN (buat, ganti, lupa), outlet, riwayat order, game spin - Halaman community, webview, coming soon, dan ikon menu beranda baru - Redesign Reward Saya: kartu tiket, filter chip, detail kode + QR - Hapus customer point loader, menu, dan checkout lama - Base URL ke enaklo-pos-api.altru.id Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
141 lines
4.3 KiB
Dart
141 lines
4.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../common/theme/theme.dart';
|
|
import '../../../../domain/wallet/wallet.dart';
|
|
import '../../wallet/wallet_ui.dart';
|
|
|
|
/// Satu outlet: nama, alamat, dan di mana EnakPoint/EnakCoin berlaku.
|
|
class OutletTile extends StatelessWidget {
|
|
const OutletTile({super.key, required this.outlet});
|
|
|
|
final Outlet outlet;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.all(14),
|
|
decoration: BoxDecoration(
|
|
color: AppColor.white,
|
|
borderRadius: BorderRadius.circular(AppValue.borderRadius),
|
|
border: Border.all(color: AppColor.borderLight),
|
|
),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
width: 40,
|
|
height: 40,
|
|
decoration: BoxDecoration(
|
|
color: AppColor.primaryWithOpacity(0.08),
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: const Icon(
|
|
Icons.storefront_rounded,
|
|
color: AppColor.primary,
|
|
size: 22,
|
|
),
|
|
),
|
|
const SizedBox(width: 12),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
outlet.name,
|
|
style: AppStyle.md.copyWith(fontWeight: FontWeight.w700),
|
|
),
|
|
if (outlet.address != null) ...[
|
|
const SizedBox(height: 2),
|
|
Text(
|
|
outlet.address!,
|
|
maxLines: 2,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: AppStyle.xs.copyWith(color: AppColor.textSecondary),
|
|
),
|
|
],
|
|
if (outlet.acceptsPointPayment ||
|
|
outlet.earnsPoints ||
|
|
outlet.earnsCoins) ...[
|
|
const SizedBox(height: 8),
|
|
Wrap(
|
|
spacing: 6,
|
|
runSpacing: 6,
|
|
children: [
|
|
if (outlet.acceptsPointPayment)
|
|
const _Chip(
|
|
label: 'Bisa bayar pakai EnakPoint',
|
|
icon: Icon(
|
|
Icons.check_circle_rounded,
|
|
size: 14,
|
|
color: AppColor.primary,
|
|
),
|
|
highlighted: true,
|
|
),
|
|
if (outlet.earnsPoints)
|
|
const _Chip(
|
|
label: 'Dapat EnakPoint',
|
|
icon: WalletCurrencyIcon(
|
|
currency: WalletCurrency.point,
|
|
size: 14,
|
|
),
|
|
),
|
|
if (outlet.earnsCoins)
|
|
const _Chip(
|
|
label: 'Dapat EnakCoin',
|
|
icon: WalletCurrencyIcon(
|
|
currency: WalletCurrency.coin,
|
|
size: 14,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _Chip extends StatelessWidget {
|
|
const _Chip({
|
|
required this.label,
|
|
required this.icon,
|
|
this.highlighted = false,
|
|
});
|
|
|
|
final String label;
|
|
final Widget icon;
|
|
final bool highlighted;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
|
decoration: BoxDecoration(
|
|
color: highlighted
|
|
? AppColor.primaryWithOpacity(0.08)
|
|
: AppColor.background,
|
|
borderRadius: BorderRadius.circular(999),
|
|
),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
icon,
|
|
const SizedBox(width: 4),
|
|
Text(
|
|
label,
|
|
style: AppStyle.xs.copyWith(
|
|
fontSize: 10,
|
|
color: highlighted ? AppColor.primary : AppColor.textPrimary,
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|