122 lines
4.0 KiB
Dart
122 lines
4.0 KiB
Dart
import 'package:flutter/material.dart';
|
||
import 'package:flutter_svg/svg.dart';
|
||
|
||
import '../Screens/subscription/package_screen.dart';
|
||
import '../constant.dart';
|
||
import '../generated/l10n.dart' as lang;
|
||
import '../model/business_info_model.dart';
|
||
|
||
Widget goToPackagePagePopup({
|
||
required BuildContext context,
|
||
required EnrolledPlan? enrolledPlan,
|
||
VoidCallback? onCancel,
|
||
VoidCallback? onUpgrade,
|
||
}) {
|
||
return AlertDialog(
|
||
backgroundColor: kWhite,
|
||
surfaceTintColor: kWhite,
|
||
elevation: 0.0,
|
||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||
contentPadding: const EdgeInsets.all(20),
|
||
titlePadding: const EdgeInsets.all(0),
|
||
content: Column(
|
||
mainAxisSize: MainAxisSize.min,
|
||
children: [
|
||
Row(
|
||
children: [
|
||
const Spacer(),
|
||
IconButton(
|
||
padding: EdgeInsets.zero,
|
||
visualDensity: const VisualDensity(horizontal: -4, vertical: -4),
|
||
onPressed: () {
|
||
if (onCancel != null) {
|
||
onCancel();
|
||
} else {
|
||
Navigator.pop(context);
|
||
}
|
||
},
|
||
icon: const Icon(
|
||
Icons.close,
|
||
color: kGreyTextColor,
|
||
)),
|
||
],
|
||
),
|
||
SvgPicture.asset(
|
||
'assets/upgradePlan.svg',
|
||
height: 198,
|
||
width: 238,
|
||
),
|
||
const SizedBox(height: 20),
|
||
FittedBox(
|
||
fit: BoxFit.scaleDown,
|
||
child: Text(
|
||
// lang.S.of(context).endYourFreePlan,
|
||
textAlign: TextAlign.center,
|
||
enrolledPlan?.plan?.subscriptionName != null ? 'End your ${enrolledPlan?.plan?.subscriptionName} plan?' : "No active plan!",
|
||
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: kTitleColor),
|
||
),
|
||
),
|
||
const SizedBox(height: 10),
|
||
Text(
|
||
enrolledPlan?.plan?.subscriptionName != null
|
||
? 'Your ${enrolledPlan?.plan?.subscriptionName} plan is almost done, buy your next plan Thanks.'
|
||
: 'You don’t have an active plan! buy your next plan now, Thanks',
|
||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: kGreyTextColor),
|
||
textAlign: TextAlign.center,
|
||
),
|
||
const SizedBox(height: 20),
|
||
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),
|
||
],
|
||
),
|
||
);
|
||
}
|