Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob][photos] Redesign header widget of subscription page

ashilkn87e3aa4d1100
diff --git a/mobile/lib/ui/payment/store_subscription_page.dart b/mobile/lib/ui/payment/store_subscription_page.dart
index 93390da22b..94b999b850 100644
--- a/mobile/lib/ui/payment/store_subscription_page.dart
+++ b/mobile/lib/ui/payment/store_subscription_page.dart
@@ -181,20 +181,14 @@ class _StoreSubscriptionPageState extends State<StoreSubscriptionPage> {
title:
widget.isOnboarding ? "Select your plan" : "Subscription",
),
- widget.isOnboarding
- ? Text(
- "Ente preserves your memories, so they’re always available to you, even if you lose your device.",
+ _isFreePlanUser() || !_hasLoadedData
+ ? const SizedBox.shrink()
+ : Text(
+ convertBytesToReadableFormat(
+ _userDetails.getTotalStorage(),
+ ),
style: textTheme.smallMuted,
- )
- : _isFreePlanUser()
- ? const SizedBox.shrink()
- : Text(
- convertBytesToReadableFormat(
- // _userDetails.getTotalStorage(),
- 1234,
- ),
- style: textTheme.smallMuted,
- ),
+ ),
],
),
),
diff --git a/mobile/lib/ui/payment/stripe_subscription_page.dart b/mobile/lib/ui/payment/stripe_subscription_page.dart
index 52e92118b5..fa34d2e7a3 100644
--- a/mobile/lib/ui/payment/stripe_subscription_page.dart
+++ b/mobile/lib/ui/payment/stripe_subscription_page.dart
@@ -167,20 +167,14 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
title:
widget.isOnboarding ? "Select your plan" : "Subscription",
),
- widget.isOnboarding
- ? Text(
- "Ente preserves your memories, so they’re always available to you, even if you lose your device.",
+ _isFreePlanUser() || !_hasLoadedData
+ ? const SizedBox.shrink()
+ : Text(
+ convertBytesToReadableFormat(
+ _userDetails.getTotalStorage(),
+ ),
style: textTheme.smallMuted,
- )
- : _isFreePlanUser()
- ? const SizedBox.shrink()
- : Text(
- convertBytesToReadableFormat(
- // _userDetails.getTotalStorage(),
- 1234,
- ),
- style: textTheme.smallMuted,
- ),
+ ),
],
),
),
diff --git a/mobile/lib/ui/payment/subscription_common_widgets.dart b/mobile/lib/ui/payment/subscription_common_widgets.dart
index 6d3cf66594..49a9a4aaed 100644
--- a/mobile/lib/ui/payment/subscription_common_widgets.dart
+++ b/mobile/lib/ui/payment/subscription_common_widgets.dart
@@ -16,10 +16,10 @@ class SubscriptionHeaderWidget extends StatefulWidget {
final int? currentUsage;
const SubscriptionHeaderWidget({
- Key? key,
+ super.key,
this.isOnboarding,
this.currentUsage,
- }) : super(key: key);
+ });
@override
State<StatefulWidget> createState() {
@@ -30,51 +30,34 @@ class SubscriptionHeaderWidget extends StatefulWidget {
class _SubscriptionHeaderWidgetState extends State<SubscriptionHeaderWidget> {
@override
Widget build(BuildContext context) {
+ final textTheme = getEnteTextTheme(context);
+ final colorScheme = getEnteColorScheme(context);
if (widget.isOnboarding!) {
return Padding(
- padding: const EdgeInsets.fromLTRB(20, 20, 20, 24),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- S.of(context).selectYourPlan,
- style: Theme.of(context).textTheme.headlineMedium,
- ),
- const SizedBox(height: 10),
- Text(
- S.of(context).enteSubscriptionPitch,
- style: Theme.of(context).textTheme.bodySmall,
- ),
- const SizedBox(height: 4),
- Text(
- S.of(context).enteSubscriptionShareWithFamily,
- style: Theme.of(context).textTheme.bodySmall,
- ),
- ],
+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+ child: Text(
+ S.of(context).enteSubscriptionPitch,
+ style: getEnteTextTheme(context).smallFaint,
),
);
} else {
- return SizedBox(
- height: 72,
- width: double.infinity,
- child: Padding(
- padding: const EdgeInsets.all(24.0),
- child: RichText(
- text: TextSpan(
- children: [
- TextSpan(
- text: S.of(context).currentUsageIs,
- style: Theme.of(context).textTheme.titleMedium,
- ),
- TextSpan(
- text: formatBytes(widget.currentUsage!),
- style: Theme.of(context)
- .textTheme
- .titleMedium!
- .copyWith(fontWeight: FontWeight.bold),
+ return Padding(
+ padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
+ child: RichText(
+ text: TextSpan(
+ children: [
+ TextSpan(
+ text: S.of(context).currentUsageIs,
+ style: textTheme.bodyFaint,
+ ),
+ TextSpan(
+ text: formatBytes(widget.currentUsage!),
+ style: textTheme.body.copyWith(
+ color: colorScheme.primary700,
+ fontWeight: FontWeight.w600,
),
- ],
- ),
+ ),
+ ],
),
),
);