|
|
@@ -24,162 +24,180 @@ class DiscountPage extends BasePage<DiscountController> {
|
|
|
|
|
|
@override
|
|
|
Widget buildBody(BuildContext context) {
|
|
|
- return Scaffold(
|
|
|
- backgroundColor: "#05050D".color,
|
|
|
- body: Stack(
|
|
|
- children: [
|
|
|
- // IgnorePointer(
|
|
|
- // child: Assets.images.bgStore.image(
|
|
|
- // width: 360.w,
|
|
|
- // ),
|
|
|
- // ),
|
|
|
- SafeArea(
|
|
|
- child: Column(
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(left: 16.w, top: 14.h),
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- Get.back();
|
|
|
- },
|
|
|
- child: Assets.images.iconStoreClose
|
|
|
- .image(width: 28.w, height: 28.w),
|
|
|
+ return Obx(() {
|
|
|
+ bool isFreeItem =
|
|
|
+ (controller.currentSelectedStoreItem.value?.freeTrialName != null);
|
|
|
+ bool isShowFree = isFreeItem && controller.isFree.value;
|
|
|
+ return Scaffold(
|
|
|
+ backgroundColor: "#05050D".color,
|
|
|
+ body: Stack(
|
|
|
+ children: [
|
|
|
+ SafeArea(
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(left: 16.w, top: 14.h),
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ Get.back();
|
|
|
+ },
|
|
|
+ child: Assets.images.iconStoreClose
|
|
|
+ .image(width: 28.w, height: 28.w),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Assets.images.iconDiscountTitle
|
|
|
- .image(width: 259.w, height: 55.h),
|
|
|
- SizedBox(
|
|
|
- height: 20.h,
|
|
|
- ),
|
|
|
- Assets.images.iconDiscountPercent
|
|
|
- .image(width: 195.w, height: 86.h),
|
|
|
- SizedBox(
|
|
|
- height: 13.h,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 197.w,
|
|
|
- height: 32.h,
|
|
|
- padding: EdgeInsets.all(1.w),
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- colors: [
|
|
|
- '#CF9EFD'.color,
|
|
|
- '#4DCFFF'.color.withOpacity(0.5),
|
|
|
- ],
|
|
|
- ),
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(18.r)),
|
|
|
+ ],
|
|
|
),
|
|
|
- child: Container(
|
|
|
+ Assets.images.iconDiscountTitle
|
|
|
+ .image(width: 259.w, height: 55.h),
|
|
|
+ SizedBox(
|
|
|
+ height: 20.h,
|
|
|
+ ),
|
|
|
+ Assets.images.iconDiscountPercent
|
|
|
+ .image(width: 195.w, height: 86.h),
|
|
|
+ SizedBox(
|
|
|
+ height: 13.h,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ width: 197.w,
|
|
|
+ height: 32.h,
|
|
|
+ padding: EdgeInsets.all(1.w),
|
|
|
decoration: BoxDecoration(
|
|
|
- color: "#05050D".color,
|
|
|
+ gradient: LinearGradient(
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ colors: [
|
|
|
+ '#CF9EFD'.color,
|
|
|
+ '#4DCFFF'.color.withOpacity(0.5),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
borderRadius: BorderRadius.all(Radius.circular(18.r)),
|
|
|
),
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- "Get CleanPro Premium",
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 15.sp,
|
|
|
- fontWeight: FontWeight.w700,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: "#05050D".color,
|
|
|
+ borderRadius: BorderRadius.all(Radius.circular(18.r)),
|
|
|
+ ),
|
|
|
+ child: Center(
|
|
|
+ child: Text(
|
|
|
+ "Get CleanPro Premium",
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 15.sp,
|
|
|
+ fontWeight: FontWeight.w700,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- SizedBox(
|
|
|
- height: 26.h,
|
|
|
- ),
|
|
|
- // 创建一个1分钟的倒计时
|
|
|
- CountdownTimer(duration: const Duration(minutes: 1)),
|
|
|
- InfinitePreviewPageView(
|
|
|
- height: 80.h,
|
|
|
- autoPlay: true,
|
|
|
- autoPlayDuration: const Duration(seconds: 3),
|
|
|
- items: [
|
|
|
- PreviewItem(
|
|
|
- title: 'Merge Duplicate Contacts',
|
|
|
- icon: Icons.people_outline,
|
|
|
- onTap: () => print('Tapped Merge'),
|
|
|
- ),
|
|
|
- PreviewItem(
|
|
|
- title: 'Clean Storage',
|
|
|
- icon: Icons.storage_outlined,
|
|
|
- onTap: () => print('Tapped Clean'),
|
|
|
+ SizedBox(
|
|
|
+ height: 26.h,
|
|
|
+ ),
|
|
|
+ // 创建一个1分钟的倒计时
|
|
|
+ CountdownTimer(duration: const Duration(minutes: 1)),
|
|
|
+ SizedBox(
|
|
|
+ height: 40.h,
|
|
|
+ ),
|
|
|
+ InfinitePreviewPageView(
|
|
|
+ height: 98.h,
|
|
|
+ autoPlay: true,
|
|
|
+ autoPlayDuration: const Duration(seconds: 5),
|
|
|
+ items: [
|
|
|
+ PreviewItem(
|
|
|
+ title: 'One-click Remove Similar Photos',
|
|
|
+ icon: Assets.images.iconStoreSimilar.image(),
|
|
|
+ ),
|
|
|
+ PreviewItem(
|
|
|
+ title: 'Detect Blurry and Junk Photos',
|
|
|
+ icon: Assets.images.iconStoreAi.image(),
|
|
|
+ ),
|
|
|
+ PreviewItem(
|
|
|
+ title: 'Merge Duplicate Contacts',
|
|
|
+ icon: Assets.images.iconStoreContacts.image(),
|
|
|
+ ),
|
|
|
+ PreviewItem(
|
|
|
+ title: 'Premium Unlimited',
|
|
|
+ icon: Assets.images.iconStorePremium.image(),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Spacer(),
|
|
|
+ Text(
|
|
|
+ isShowFree
|
|
|
+ ? controller.currentSelectedStoreItem.value
|
|
|
+ ?.freeTrialName ??
|
|
|
+ ""
|
|
|
+ : controller.currentSelectedStoreItem.value?.name ?? "",
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
),
|
|
|
- PreviewItem(
|
|
|
- title: 'Backup Photos',
|
|
|
- icon: Icons.photo_library_outlined,
|
|
|
- onTap: () => print('Tapped Backup'),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ isShowFree
|
|
|
+ ? controller.currentSelectedStoreItem.value
|
|
|
+ ?.freeTrialPriceDesc ??
|
|
|
+ ""
|
|
|
+ : controller
|
|
|
+ .currentSelectedStoreItem.value?.priceDesc ??
|
|
|
+ "",
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontSize: 13.sp,
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Spacer(),
|
|
|
- Text(
|
|
|
- "3-Day Free Trial",
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 16.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
),
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "Then \$69.99",
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontSize: 13.sp,
|
|
|
+ SizedBox(
|
|
|
+ height: 14.h,
|
|
|
),
|
|
|
- ),
|
|
|
- SizedBox(
|
|
|
- height: 14.h,
|
|
|
- ),
|
|
|
- GestureDetector(
|
|
|
- onTap: () {
|
|
|
- // controller.onBuyClick();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- width: 312.w,
|
|
|
- height: 48.h,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: "#0279FB".color,
|
|
|
- borderRadius: BorderRadius.all(
|
|
|
- Radius.circular(24.r),
|
|
|
+ GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ controller.onBuyClick();
|
|
|
+ },
|
|
|
+ child: Container(
|
|
|
+ width: 312.w,
|
|
|
+ height: 48.h,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: "#0279FB".color,
|
|
|
+ borderRadius: BorderRadius.all(
|
|
|
+ Radius.circular(24.r),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- "START FREE TRIAL",
|
|
|
- style: TextStyle(
|
|
|
- color: Colors.white,
|
|
|
- fontWeight: FontWeight.w700,
|
|
|
- fontSize: 16.sp,
|
|
|
+ child: Center(
|
|
|
+ child: Text(
|
|
|
+ isShowFree
|
|
|
+ ? "START FREE TRIAL"
|
|
|
+ : "START NOW",
|
|
|
+ style: TextStyle(
|
|
|
+ color: Colors.white,
|
|
|
+ fontWeight: FontWeight.w700,
|
|
|
+ fontSize: 16.sp,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- SizedBox(
|
|
|
- height: 5.h,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "No payment now!",
|
|
|
- style: TextStyle(
|
|
|
- color: "#57C87A".color,
|
|
|
- fontSize: 12.sp,
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
+ SizedBox(
|
|
|
+ height: 5.h,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ isShowFree
|
|
|
+ ? "No payment now!"
|
|
|
+ : "Cancel anytime",
|
|
|
+ style: TextStyle(
|
|
|
+ color: isShowFree ? "#57C87A".color : Colors.white,
|
|
|
+ fontSize: 12.sp,
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- );
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ });
|
|
|
}
|
|
|
-}
|
|
|
+}
|