update subcription portal

This commit is contained in:
2026-02-08 10:31:54 +07:00
parent 28a376fc4d
commit dc1147fd9e
4 changed files with 125 additions and 8 deletions

View File

@@ -6,7 +6,12 @@ import '../constant.dart';
import '../generated/l10n.dart' as lang;
import '../model/business_info_model.dart';
Widget goToPackagePagePopup({required BuildContext context, required EnrolledPlan? enrolledPlan}) {
Widget goToPackagePagePopup({
required BuildContext context,
required EnrolledPlan? enrolledPlan,
VoidCallback? onCancel,
VoidCallback? onUpgrade,
}) {
return AlertDialog(
backgroundColor: kWhite,
surfaceTintColor: kWhite,
@@ -24,7 +29,11 @@ Widget goToPackagePagePopup({required BuildContext context, required EnrolledPla
padding: EdgeInsets.zero,
visualDensity: const VisualDensity(horizontal: -4, vertical: -4),
onPressed: () {
Navigator.pop(context);
if (onCancel != null) {
onCancel();
} else {
Navigator.pop(context);
}
},
icon: const Icon(
Icons.close,
@@ -56,11 +65,55 @@ Widget goToPackagePagePopup({required BuildContext context, required EnrolledPla
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
ElevatedButton(
child: Text(lang.S.of(context).upgradeNow),
onPressed: () {
Navigator.pop(context);
}),
Row(
children: [
Expanded(
child: OutlinedButton(
style: OutlinedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 13),
side: const BorderSide(color: Colors.red),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
onPressed: () {
if (onCancel != null) {
onCancel();
} else {
Navigator.pop(context);
}
},
child: Text(
lang.S.of(context).cancel,
style: const TextStyle(color: Colors.red),
),
),
),
const SizedBox(width: 10),
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 13),
backgroundColor: kMainColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
child: Text(
lang.S.of(context).upgradeNow,
style: const TextStyle(color: Colors.white),
),
onPressed: () {
if (onUpgrade != null) {
onUpgrade();
} else {
Navigator.pop(context);
}
},
),
),
],
),
const SizedBox(height: 5),
],
),