[mob][photos] Redesign header widget of subscription page
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
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,
|
||||
),
|
||||
TextSpan(
|
||||
text: formatBytes(widget.currentUsage!),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleMedium!
|
||||
.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user