44 lines
1.2 KiB
Dart
44 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|||
|
|
|
||
|
|
import '../../../../common/theme/theme.dart';
|
||
|
|
|
||
|
|
/// Konfirmasi sebelum transaksi yang tidak bisa dibatalkan.
|
||
|
|
Future<bool> showWalletConfirmDialog(
|
||
|
|
BuildContext context, {
|
||
|
|
required String title,
|
||
|
|
required String message,
|
||
|
|
required String confirmLabel,
|
||
|
|
}) async {
|
||
|
|
final confirmed = await showDialog<bool>(
|
||
|
|
context: context,
|
||
|
|
builder: (dialogContext) => AlertDialog(
|
||
|
|
backgroundColor: AppColor.white,
|
||
|
|
title: Text(
|
||
|
|
title,
|
||
|
|
style: AppStyle.lg.copyWith(fontWeight: FontWeight.w700),
|
||
|
|
),
|
||
|
|
content: Text(message, style: AppStyle.md),
|
||
|
|
actions: [
|
||
|
|
TextButton(
|
||
|
|
onPressed: () => Navigator.of(dialogContext).pop(false),
|
||
|
|
child: Text(
|
||
|
|
'Batal',
|
||
|
|
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
TextButton(
|
||
|
|
onPressed: () => Navigator.of(dialogContext).pop(true),
|
||
|
|
child: Text(
|
||
|
|
confirmLabel,
|
||
|
|
style: AppStyle.md.copyWith(
|
||
|
|
color: AppColor.primary,
|
||
|
|
fontWeight: FontWeight.w700,
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
);
|
||
|
|
return confirmed == true;
|
||
|
|
}
|