35 lines
1008 B
Dart
35 lines
1008 B
Dart
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),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|