Tab Community, tombol Bayar di navbar, logo placeholder, fix crash PIN

- Bottom navbar: Home, Pesanan, Bayar (tombol tengah ke kode bayar),
  Community, Profil; menu EnakCommunity di beranda pindah ke tab
- Image placeholder: logo Enaklo diperbesar, ilustrasi gelas dihapus
- Fix assertion Navigator saat PIN gagal karena error non-PIN: flushbar
  kini tampil lewat onFailure setelah sheet PIN tertutup (bayar, tukar,
  transfer)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
efrilm
2026-10-01 02:05:49 +07:00
co-authored by Claude Opus 5.5
parent f5e3075205
commit bc751246d8
11 changed files with 151 additions and 144 deletions
@@ -139,6 +139,7 @@ class _ExchangePageState extends State<ExchangePage> {
final result = await bloc.stream.firstWhere((s) => !s.isSubmitting);
return result.failureOption.toNullable();
},
onFailure: _showFailure,
);
if (success && mounted) {
@@ -173,11 +174,6 @@ class _ExchangePageState extends State<ExchangePage> {
Widget build(BuildContext context) {
return MultiBlocListener(
listeners: [
BlocListener<ExchangeFormBloc, ExchangeFormState>(
listenWhen: (p, c) => p.failureOption != c.failureOption,
listener: (context, state) =>
state.failureOption.fold(() {}, _showFailure),
),
BlocListener<ExchangeFormBloc, ExchangeFormState>(
listenWhen: (p, c) => p.preview != c.preview && c.preview != null,
listener: (context, state) => setState(() => _rate = state.preview),
@@ -73,18 +73,13 @@ class _PaymentCodePageState extends State<PaymentCodePage> {
final state = await bloc.stream.firstWhere((s) => !s.isSubmitting);
return state.failureOption.toNullable();
},
onFailure: (f) => AppFlushbar.showError(context, walletFailureMessage(f)),
);
}
@override
Widget build(BuildContext context) {
return BlocConsumer<PaymentCodeFormBloc, PaymentCodeFormState>(
listenWhen: (p, c) => p.failureOption != c.failureOption,
listener: (context, state) => state.failureOption.fold(() {}, (f) {
if (!f.isPinError) {
AppFlushbar.showError(context, walletFailureMessage(f));
}
}),
return BlocBuilder<PaymentCodeFormBloc, PaymentCodeFormState>(
builder: (context, state) {
final code = state.paymentCode;
@@ -130,6 +130,7 @@ class _TransferPageState extends State<TransferPage> {
final result = await bloc.stream.firstWhere((s) => !s.isSubmitting);
return result.failureOption.toNullable();
},
onFailure: _showFailure,
);
if (success && mounted) {
@@ -201,11 +202,6 @@ class _TransferPageState extends State<TransferPage> {
Widget build(BuildContext context) {
return MultiBlocListener(
listeners: [
BlocListener<TransferFormBloc, TransferFormState>(
listenWhen: (p, c) => p.failureOption != c.failureOption,
listener: (context, state) =>
state.failureOption.fold(() {}, _showFailure),
),
BlocListener<TransferFormBloc, TransferFormState>(
listenWhen: (p, c) =>
p.recipient != c.recipient && c.recipient != null,