Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Add animation when to price when switching between monthly and yearly plans

ashilkn63fe67d677b8
diff --git a/mobile/lib/ui/payment/stripe_subscription_page.dart b/mobile/lib/ui/payment/stripe_subscription_page.dart
index 02b782c700..0bc844acf7 100644
--- a/mobile/lib/ui/payment/stripe_subscription_page.dart
+++ b/mobile/lib/ui/payment/stripe_subscription_page.dart
@@ -212,10 +212,8 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
widgets.add(
SubscriptionToggle(
onToggle: (p0) {
- Future.delayed(const Duration(milliseconds: 175), () {
- _showYearlyPlan = p0;
- _filterStripeForUI();
- });
+ _showYearlyPlan = p0;
+ _filterStripeForUI();
},
),
);
diff --git a/mobile/lib/ui/payment/subscription_plan_widget.dart b/mobile/lib/ui/payment/subscription_plan_widget.dart
index b993abcaa8..e1221e6b31 100644
--- a/mobile/lib/ui/payment/subscription_plan_widget.dart
+++ b/mobile/lib/ui/payment/subscription_plan_widget.dart
@@ -1,6 +1,7 @@
import "package:flutter/foundation.dart";
import 'package:flutter/material.dart';
import "package:flutter/scheduler.dart";
+import "package:flutter_animate/flutter_animate.dart";
import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
import 'package:photos/utils/data_util.dart';
@@ -139,19 +140,14 @@ class _Price extends StatelessWidget {
);
}
if (period == "month") {
- return RichText(
- text: TextSpan(
- children: <TextSpan>[
- TextSpan(
- text: price,
- style: textTheme.largeBold.copyWith(color: textBaseLight),
- ),
- TextSpan(
- text: ' / ' 'month',
- style: textTheme.largeBold.copyWith(color: textBaseLight),
- ),
- ],
- ),
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Text(
+ price + ' / ' + 'month',
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
+ ).animate().fadeIn(duration: const Duration(milliseconds: 175)),
+ ],
);
} else if (period == "year") {
final currencySymbol = price[0];
@@ -162,26 +158,16 @@ class _Price extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
- RichText(
- text: TextSpan(
- children: <TextSpan>[
- TextSpan(
- text: currencySymbol + pricePerMonthString,
- style: textTheme.largeBold.copyWith(color: textBaseLight),
- ),
- TextSpan(
- text: ' / ' 'month',
- style: textTheme.largeBold.copyWith(color: textBaseLight),
- ),
- ],
- ),
+ Text(
+ currencySymbol + pricePerMonthString + ' / ' + 'month',
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
),
Text(
price + " / " + "yr",
style: textTheme.body.copyWith(color: textFaintLight),
),
],
- );
+ ).animate().fadeIn(duration: const Duration(milliseconds: 175));
} else {
assert(false, "Invalid period: $period");
return const Text("");