Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Update subscription page colors

ashilknb2103e389368
diff --git a/mobile/lib/theme/colors.dart b/mobile/lib/theme/colors.dart
index 27d868c1c3..be8ed8e7e4 100644
--- a/mobile/lib/theme/colors.dart
+++ b/mobile/lib/theme/colors.dart
@@ -36,7 +36,6 @@ class EnteColorScheme {
final Color blurStrokeBase;
final Color blurStrokeFaint;
final Color blurStrokePressed;
- final Color subscriptionPlanWidgetStoke;
// Fixed Colors
final Color primary700;
@@ -58,7 +57,6 @@ class EnteColorScheme {
//other colors
final Color tabIcon;
final List<Color> avatarColors;
- final Color subscriptionPlanWidgetColor;
const EnteColorScheme(
this.backgroundBase,
@@ -85,10 +83,8 @@ class EnteColorScheme {
this.blurStrokeBase,
this.blurStrokeFaint,
this.blurStrokePressed,
- this.subscriptionPlanWidgetStoke,
this.tabIcon,
- this.avatarColors,
- this.subscriptionPlanWidgetColor, {
+ this.avatarColors, {
this.primary700 = _primary700,
this.primary500 = _primary500,
this.primary400 = _primary400,
@@ -128,10 +124,8 @@ const EnteColorScheme lightScheme = EnteColorScheme(
blurStrokeBaseLight,
blurStrokeFaintLight,
blurStrokePressedLight,
- subscriptionPlanWidgetStokeLight,
tabIconLight,
avatarLight,
- subscriptionPlanWidgetLight,
);
const EnteColorScheme darkScheme = EnteColorScheme(
@@ -159,10 +153,8 @@ const EnteColorScheme darkScheme = EnteColorScheme(
blurStrokeBaseDark,
blurStrokeFaintDark,
blurStrokePressedDark,
- subscriptionPlanWidgetDark,
tabIconDark,
avatarDark,
- subscriptionPlanWidgetDark,
);
// Background Colors
@@ -228,14 +220,9 @@ const Color blurStrokeBaseDark = Color.fromRGBO(255, 255, 255, 0.90);
const Color blurStrokeFaintDark = Color.fromRGBO(255, 255, 255, 0.06);
const Color blurStrokePressedDark = Color.fromRGBO(255, 255, 255, 0.50);
-const Color subscriptionPlanWidgetStokeLight = Color.fromRGBO(229, 229, 229, 1);
-const Color subscriptionPlanWidgetStokeDark = Color.fromRGBO(44, 44, 44, 1);
-
// Other colors
const Color tabIconLight = Color.fromRGBO(0, 0, 0, 0.85);
const Color tabIconDark = Color.fromRGBO(255, 255, 255, 0.80);
-const Color subscriptionPlanWidgetDark = Color.fromRGBO(255, 255, 255, 0.04);
-const Color subscriptionPlanWidgetLight = Color.fromRGBO(251, 251, 251, 1);
// Fixed Colors
diff --git a/mobile/lib/ui/payment/subscription_plan_widget.dart b/mobile/lib/ui/payment/subscription_plan_widget.dart
index 75860347cf..e7a1ea2fc3 100644
--- a/mobile/lib/ui/payment/subscription_plan_widget.dart
+++ b/mobile/lib/ui/payment/subscription_plan_widget.dart
@@ -1,8 +1,11 @@
+import "package:flutter/foundation.dart";
import 'package:flutter/material.dart';
+import "package:flutter/scheduler.dart";
+import "package:photos/theme/colors.dart";
import "package:photos/theme/ente_theme.dart";
import 'package:photos/utils/data_util.dart';
-class SubscriptionPlanWidget extends StatelessWidget {
+class SubscriptionPlanWidget extends StatefulWidget {
const SubscriptionPlanWidget({
super.key,
required this.storage,
@@ -16,9 +19,23 @@ class SubscriptionPlanWidget extends StatelessWidget {
final String period;
final bool isActive;
+ @override
+ State<SubscriptionPlanWidget> createState() => _SubscriptionPlanWidgetState();
+}
+
+class _SubscriptionPlanWidgetState extends State<SubscriptionPlanWidget> {
+ late final PlatformDispatcher _platformDispatcher;
+
+ @override
+ void initState() {
+ super.initState();
+ _platformDispatcher = SchedulerBinding.instance.platformDispatcher;
+ }
+
@override
Widget build(BuildContext context) {
- final numAndUnit = convertBytesToNumberAndUnit(storage);
+ final brightness = _platformDispatcher.platformBrightness;
+ final numAndUnit = convertBytesToNumberAndUnit(widget.storage);
final String storageValue = numAndUnit.$1.toString();
final String storageUnit = numAndUnit.$2;
final colorScheme = getEnteColorScheme(context);
@@ -27,10 +44,16 @@ class SubscriptionPlanWidget extends StatelessWidget {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
- color: colorScheme.subscriptionPlanWidgetColor,
+ color: backgroundElevated2Light,
borderRadius: BorderRadius.circular(8),
border: Border.all(
- color: colorScheme.subscriptionPlanWidgetStoke,
+ color: brightness == Brightness.dark
+ ? widget.isActive
+ ? const Color.fromRGBO(191, 191, 191, 1)
+ : strokeMutedLight
+ : widget.isActive
+ ? const Color.fromRGBO(177, 177, 177, 1)
+ : const Color.fromRGBO(66, 66, 66, 0.4),
width: 1,
),
),
@@ -42,10 +65,10 @@ class SubscriptionPlanWidget extends StatelessWidget {
children: [
TextSpan(
text: storageValue,
- style: TextStyle(
+ style: const TextStyle(
fontSize: 40,
fontWeight: FontWeight.w600,
- color: getEnteColorScheme(context).textBase,
+ color: textBaseLight,
),
),
WidgetSpan(
@@ -53,14 +76,16 @@ class SubscriptionPlanWidget extends StatelessWidget {
offset: const Offset(2, -16),
child: Text(
storageUnit,
- style: getEnteTextTheme(context).h3Muted,
+ style: getEnteTextTheme(context).h3.copyWith(
+ color: textMutedLight,
+ ),
),
),
),
],
),
),
- _Price(price: price, period: period),
+ _Price(price: widget.price, period: widget.period),
],
),
),
@@ -75,12 +100,11 @@ class _Price extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
if (price.isEmpty) {
return Text(
"Free",
- style: textTheme.largeBold,
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
);
}
if (period == "month") {
@@ -89,9 +113,12 @@ class _Price extends StatelessWidget {
children: <TextSpan>[
TextSpan(
text: price,
- style: textTheme.largeBold,
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
+ ),
+ TextSpan(
+ text: ' / ' 'month',
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
),
- TextSpan(text: ' / ' 'month', style: textTheme.largeBold),
],
),
);
@@ -109,18 +136,18 @@ class _Price extends StatelessWidget {
children: <TextSpan>[
TextSpan(
text: currencySymbol + pricePerMonthString,
- style: textTheme.largeBold,
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
),
TextSpan(
text: ' / ' 'month',
- style: textTheme.largeBold,
+ style: textTheme.largeBold.copyWith(color: textBaseLight),
),
],
),
),
Text(
price + " / " + "yr",
- style: textTheme.bodyFaint,
+ style: textTheme.body.copyWith(color: textFaintLight),
),
],
);