Skip to content

Commit 726ccb6

Browse files
committed
subscription_list [nfc]: Place provisional dark-theme colors pending design
Like we did in a recent commit for the "Direct messages" screen, and like we did for the "Inbox" screen in c6abaf9.
1 parent 07131d2 commit 726ccb6

File tree

2 files changed

+36
-25
lines changed

2 files changed

+36
-25
lines changed

lib/widgets/subscription_list.dart

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,15 @@ class _NoSubscriptionsItem extends StatelessWidget {
120120

121121
@override
122122
Widget build(BuildContext context) {
123+
final designVariables = DesignVariables.of(context);
124+
123125
return SliverToBoxAdapter(
124126
child: Padding(
125127
padding: const EdgeInsets.all(10),
126128
child: Text("No channels found",
127129
textAlign: TextAlign.center,
128130
style: TextStyle(
129-
// TODO(#95) need dark-theme color
130-
color: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.5).toColor(),
131+
color: designVariables.subscriptionListHeaderText,
131132
fontSize: 18,
132133
height: (20 / 18),
133134
))));
@@ -139,34 +140,34 @@ class _SubscriptionListHeader extends StatelessWidget {
139140

140141
final String label;
141142

142-
static final _line = Expanded(child: Divider(
143-
// TODO(#95) need dark-theme color
144-
color: const HSLColor.fromAHSL(0.2, 240, 0.1, 0.5).toColor()));
145-
146143
@override
147144
Widget build(BuildContext context) {
145+
final designVariables = DesignVariables.of(context);
146+
147+
final line = Expanded(child: Divider(
148+
color: designVariables.subscriptionListHeaderLine));
149+
148150
return SliverToBoxAdapter(
149151
child: ColoredBox(
150-
// TODO(#95) need dark-theme color
151-
color: Colors.white,
152+
// TODO(design) check if this is the right variable
153+
color: designVariables.background,
152154
child: Row(crossAxisAlignment: CrossAxisAlignment.center,
153155
children: [
154156
const SizedBox(width: 16),
155-
_line,
157+
line,
156158
const SizedBox(width: 8),
157159
Padding(
158160
padding: const EdgeInsets.symmetric(vertical: 7),
159161
child: Text(label,
160162
textAlign: TextAlign.center,
161163
style: TextStyle(
162-
// TODO(#95) need dark-theme color
163-
color: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.5).toColor(),
164+
color: designVariables.subscriptionListHeaderText,
164165
fontSize: 14,
165166
letterSpacing: proportionalLetterSpacing(context, 0.04, baseFontSize: 14),
166167
height: (16 / 14),
167168
))),
168169
const SizedBox(width: 8),
169-
_line,
170+
line,
170171
const SizedBox(width: 16),
171172
])));
172173
}
@@ -207,12 +208,14 @@ class SubscriptionItem extends StatelessWidget {
207208

208209
@override
209210
Widget build(BuildContext context) {
211+
final designVariables = DesignVariables.of(context);
212+
210213
final swatch = colorSwatchFor(context, subscription);
211214
final hasUnreads = (unreadCount > 0);
212215
final opacity = subscription.isMuted ? 0.55 : 1.0;
213216
return Material(
214-
// TODO(#95) need dark-theme color
215-
color: Colors.white,
217+
// TODO(design) check if this is the right variable
218+
color: designVariables.background,
216219
child: InkWell(
217220
onTap: () {
218221
Navigator.push(context,
@@ -237,19 +240,11 @@ class SubscriptionItem extends StatelessWidget {
237240
child: Opacity(
238241
opacity: opacity,
239242
child: Text(
240-
style: const TextStyle(
243+
style: TextStyle(
241244
fontSize: 18,
242245
height: (20 / 18),
243-
// The old, soon-to-be-outdated Figma has #262626:
244-
// https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=171-12359&t=OgFPAdLiXz9OEzCF-0
245-
// That might be accidental, though. The same page has
246-
// #222222 for the topics. The "Inbox" page in that Figma
247-
// has #222222 for the "Private messages" header, but yeah,
248-
// #262626 for the channel headers. Hmm...on our "Inbox",
249-
// looks like we just took #222222 for both those headers.
250-
// Anyway, eager to have the updated Figma to work from.
251-
// TODO(#95) need dark-theme color
252-
color: Color(0xff222222),
246+
// TODO(design) check if this is the right variable
247+
color: designVariables.labelMenuButton,
253248
).merge(weightVariableTextStyle(context,
254249
wght: hasUnreads ? 600 : null)),
255250
maxLines: 1,

lib/widgets/theme.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
150150
loginOrDividerText: const Color(0xff575757),
151151
sectionCollapseIcon: const Color(0x7f1e2e48),
152152
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
153+
subscriptionListHeaderLine: const HSLColor.fromAHSL(0.2, 240, 0.1, 0.5).toColor(),
154+
subscriptionListHeaderText: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.5).toColor(),
153155
unreadCountBadgeTextForChannel: Colors.black.withOpacity(0.9),
154156
);
155157

@@ -181,6 +183,10 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
181183
sectionCollapseIcon: const Color(0x7fb6c8e2),
182184
// TODO(#95) unchanged in dark theme?
183185
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
186+
// TODO(#95) need proper dark-theme color (this is ad hoc)
187+
subscriptionListHeaderLine: const HSLColor.fromAHSL(0.4, 240, 0.1, 0.75).toColor(),
188+
// TODO(#95) need proper dark-theme color (this is ad hoc)
189+
subscriptionListHeaderText: const HSLColor.fromAHSL(1.0, 240, 0.1, 0.75).toColor(),
184190
unreadCountBadgeTextForChannel: Colors.white.withOpacity(0.9),
185191
);
186192

@@ -206,6 +212,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
206212
required this.loginOrDividerText,
207213
required this.sectionCollapseIcon,
208214
required this.star,
215+
required this.subscriptionListHeaderLine,
216+
required this.subscriptionListHeaderText,
209217
required this.unreadCountBadgeTextForChannel,
210218
});
211219

@@ -244,6 +252,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
244252
final Color loginOrDividerText; // TODO(#95) need proper dark-theme color (this is ad hoc)
245253
final Color sectionCollapseIcon;
246254
final Color star;
255+
final Color subscriptionListHeaderLine;
256+
final Color subscriptionListHeaderText;
247257
final Color unreadCountBadgeTextForChannel;
248258

249259
@override
@@ -269,6 +279,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
269279
Color? loginOrDividerText,
270280
Color? sectionCollapseIcon,
271281
Color? star,
282+
Color? subscriptionListHeaderLine,
283+
Color? subscriptionListHeaderText,
272284
Color? unreadCountBadgeTextForChannel,
273285
}) {
274286
return DesignVariables._(
@@ -293,6 +305,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
293305
loginOrDividerText: loginOrDividerText ?? this.loginOrDividerText,
294306
sectionCollapseIcon: sectionCollapseIcon ?? this.sectionCollapseIcon,
295307
star: star ?? this.star,
308+
subscriptionListHeaderLine: subscriptionListHeaderLine ?? this.subscriptionListHeaderLine,
309+
subscriptionListHeaderText: subscriptionListHeaderText ?? this.subscriptionListHeaderText,
296310
unreadCountBadgeTextForChannel: unreadCountBadgeTextForChannel ?? this.unreadCountBadgeTextForChannel,
297311
);
298312
}
@@ -324,6 +338,8 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
324338
loginOrDividerText: Color.lerp(loginOrDividerText, other.loginOrDividerText, t)!,
325339
sectionCollapseIcon: Color.lerp(sectionCollapseIcon, other.sectionCollapseIcon, t)!,
326340
star: Color.lerp(star, other.star, t)!,
341+
subscriptionListHeaderLine: Color.lerp(subscriptionListHeaderLine, other.subscriptionListHeaderLine, t)!,
342+
subscriptionListHeaderText: Color.lerp(subscriptionListHeaderText, other.subscriptionListHeaderText, t)!,
327343
unreadCountBadgeTextForChannel: Color.lerp(unreadCountBadgeTextForChannel, other.unreadCountBadgeTextForChannel, t)!,
328344
);
329345
}

0 commit comments

Comments
 (0)