Added dialog window to confirm or reject processed payment
This commit is contained in:
34
frontend/pweb/lib/widgets/dialogs/payment_status_dialog.dart
Normal file
34
frontend/pweb/lib/widgets/dialogs/payment_status_dialog.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:pweb/generated/i18n/app_localizations.dart';
|
||||
|
||||
|
||||
Future<void> showPaymentStatusDialog(BuildContext context, {required bool isSuccess}) {
|
||||
return showDialog<void>(
|
||||
context: context,
|
||||
builder: (dialogContext) {
|
||||
final l10n = AppLocalizations.of(dialogContext)!;
|
||||
return AlertDialog(
|
||||
icon: isSuccess
|
||||
? const Icon(Icons.check_circle, color: Colors.green, size: 48)
|
||||
: const Icon(Icons.error, color: Colors.red, size: 48),
|
||||
title: Text(
|
||||
isSuccess
|
||||
? l10n.paymentStatusSuccessTitle
|
||||
: l10n.paymentStatusFailureTitle,
|
||||
),
|
||||
content: Text(
|
||||
isSuccess
|
||||
? l10n.paymentStatusSuccessMessage
|
||||
: l10n.paymentStatusFailureMessage,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(dialogContext).pop(),
|
||||
child: Text(l10n.ok),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user