Skip to content

Commit c6abaf9

Browse files
committed
inbox [nfc]: Place provisional dark-theme color variants, pending design
This completes a workable dark-theme implementation for the inbox screen. It's likely that some colors will be tweaked to follow designs that haven't been made yet. As noted in TODOs in each color that's placed here: - Some of the UI elements are colored with actual design variables from the new Figma that's marked ready for dev. But that Figma doesn't yet have those same UI elements, so it's unclear if it's the right choice of variable. - Some dark-theme colors were made up by me just now. NFC because none of the light-theme colors are changed, and we don't support dark theme yet.
1 parent ff86969 commit c6abaf9

File tree

2 files changed

+41
-24
lines changed

2 files changed

+41
-24
lines changed

lib/widgets/inbox.dart

+25-24
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ abstract class _HeaderItem extends StatelessWidget {
245245

246246
@override
247247
Widget build(BuildContext context) {
248+
final designVariables = DesignVariables.of(context);
248249
return Material(
249-
// TODO(#95) need dark-theme color
250-
color: collapsed ? Colors.white : uncollapsedBackgroundColor(context),
250+
color: collapsed
251+
? designVariables.background // TODO(design) check if this is the right variable
252+
: uncollapsedBackgroundColor(context),
251253
child: InkWell(
252254
// TODO use onRowTap to handle taps that are not on the collapse button.
253255
// Probably we should give the collapse button a 44px or 48px square
@@ -258,8 +260,7 @@ abstract class _HeaderItem extends StatelessWidget {
258260
onTap: onCollapseButtonTap,
259261
child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
260262
Padding(padding: const EdgeInsets.all(10),
261-
// TODO(#95) need dark-theme color
262-
child: Icon(size: 20, color: const Color(0x7F1D2E48),
263+
child: Icon(size: 20, color: designVariables.sectionCollapseIcon,
263264
collapsed ? ZulipIcons.arrow_right : ZulipIcons.arrow_down)),
264265
Icon(size: 18,
265266
color: collapsed
@@ -270,11 +271,11 @@ abstract class _HeaderItem extends StatelessWidget {
270271
Expanded(child: Padding(
271272
padding: const EdgeInsets.symmetric(vertical: 4),
272273
child: Text(
273-
style: const TextStyle(
274+
style: TextStyle(
274275
fontSize: 17,
275276
height: (20 / 17),
276-
// TODO(#95) need dark-theme color
277-
color: Color(0xFF222222),
277+
// TODO(design) check if this is the right variable
278+
color: designVariables.labelMenuButton,
278279
).merge(weightVariableTextStyle(context, wght: 600)),
279280
maxLines: 1,
280281
overflow: TextOverflow.ellipsis,
@@ -302,9 +303,9 @@ class _AllDmsHeaderItem extends _HeaderItem {
302303
@override String get title => 'Direct messages'; // TODO(i18n)
303304
@override IconData get icon => ZulipIcons.user;
304305

305-
// TODO(#95) need dark-theme colors
306-
@override Color collapsedIconColor(context) => const Color(0xFF222222);
307-
@override Color uncollapsedIconColor(context) => const Color(0xFF222222);
306+
// TODO(design) check if this is the right variable for these
307+
@override Color collapsedIconColor(context) => DesignVariables.of(context).labelMenuButton;
308+
@override Color uncollapsedIconColor(context) => DesignVariables.of(context).labelMenuButton;
308309

309310
@override Color uncollapsedBackgroundColor(context) => DesignVariables.of(context).dmHeaderBg;
310311
@override Color? unreadCountBadgeBackgroundColor(context) => null;
@@ -368,6 +369,8 @@ class _DmItem extends StatelessWidget {
368369
final store = PerAccountStoreWidget.of(context);
369370
final selfUser = store.users[store.selfUserId]!;
370371

372+
final designVariables = DesignVariables.of(context);
373+
371374
final title = switch (narrow.otherRecipientIds) { // TODO dedupe with [RecentDmConversationsItem]
372375
[] => selfUser.fullName,
373376
[var otherUserId] => store.users[otherUserId]?.fullName ?? '(unknown user)',
@@ -379,8 +382,7 @@ class _DmItem extends StatelessWidget {
379382
};
380383

381384
return Material(
382-
// TODO(#95) need dark-theme color
383-
color: Colors.white,
385+
color: designVariables.background, // TODO(design) check if this is the right variable
384386
child: InkWell(
385387
onTap: () {
386388
Navigator.push(context,
@@ -392,11 +394,11 @@ class _DmItem extends StatelessWidget {
392394
Expanded(child: Padding(
393395
padding: const EdgeInsets.symmetric(vertical: 4),
394396
child: Text(
395-
style: const TextStyle(
397+
style: TextStyle(
396398
fontSize: 17,
397399
height: (20 / 17),
398-
// TODO(#95) need dark-theme color
399-
color: Color(0xFF222222),
400+
// TODO(design) check if this is the right variable
401+
color: designVariables.labelMenuButton,
400402
),
401403
maxLines: 2,
402404
overflow: TextOverflow.ellipsis,
@@ -501,9 +503,10 @@ class _TopicItem extends StatelessWidget {
501503
final store = PerAccountStoreWidget.of(context);
502504
final subscription = store.subscriptions[streamId]!;
503505

506+
final designVariables = DesignVariables.of(context);
507+
504508
return Material(
505-
// TODO(#95) need dark-theme color
506-
color: Colors.white,
509+
color: designVariables.background, // TODO(design) check if this is the right variable
507510
child: InkWell(
508511
onTap: () {
509512
final narrow = TopicNarrow(streamId, topic);
@@ -516,11 +519,11 @@ class _TopicItem extends StatelessWidget {
516519
Expanded(child: Padding(
517520
padding: const EdgeInsets.symmetric(vertical: 4),
518521
child: Text(
519-
style: const TextStyle(
522+
style: TextStyle(
520523
fontSize: 17,
521524
height: (20 / 17),
522-
// TODO(#95) need dark-theme color
523-
color: Color(0xFF222222),
525+
// TODO(design) check if this is the right variable
526+
color: designVariables.labelMenuButton,
524527
),
525528
maxLines: 2,
526529
overflow: TextOverflow.ellipsis,
@@ -538,15 +541,13 @@ class _TopicItem extends StatelessWidget {
538541
class _AtMentionMarker extends StatelessWidget {
539542
const _AtMentionMarker();
540543

541-
// TODO(#95) need dark-theme color
542-
static final markerColor = const HSLColor.fromAHSL(0.5, 0, 0, 0.2).toColor();
543-
544544
@override
545545
Widget build(BuildContext context) {
546+
final designVariables = DesignVariables.of(context);
546547
// Design for at-mention marker based on Figma screen:
547548
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?type=design&node-id=224-16386&mode=design&t=JsNndFQ8fKFH0SjS-0
548549
return Padding(
549550
padding: const EdgeInsetsDirectional.only(end: 4),
550-
child: Icon(ZulipIcons.at_sign, size: 14, color: markerColor));
551+
child: Icon(ZulipIcons.at_sign, size: 14, color: designVariables.atMentionMarker));
551552
}
552553
}

lib/widgets/theme.dart

+16
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,11 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
139139
mainBackground: const Color(0xfff0f0f0),
140140
title: const Color(0xff1a1a1a),
141141
channelColorSwatches: ChannelColorSwatches.light,
142+
atMentionMarker: const HSLColor.fromAHSL(0.5, 0, 0, 0.2).toColor(),
142143
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.35, 0.93).toColor(),
143144
loginOrDivider: const Color(0xffdedede),
144145
loginOrDividerText: const Color(0xff575757),
146+
sectionCollapseIcon: const Color(0x7f1e2e48),
145147
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
146148
unreadCountBadgeTextForChannel: Colors.black.withOpacity(0.9),
147149
);
@@ -158,9 +160,13 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
158160
mainBackground: const Color(0xff1d1d1d),
159161
title: const Color(0xffffffff),
160162
channelColorSwatches: ChannelColorSwatches.dark,
163+
// TODO(#95) need proper dark-theme color (this is ad hoc)
164+
atMentionMarker: const HSLColor.fromAHSL(0.4, 0, 0, 1).toColor(),
161165
dmHeaderBg: const HSLColor.fromAHSL(1, 46, 0.15, 0.2).toColor(),
162166
loginOrDivider: const Color(0xff424242),
163167
loginOrDividerText: const Color(0xffa8a8a8),
168+
// TODO(#95) need proper dark-theme color (this is ad hoc)
169+
sectionCollapseIcon: const Color(0x7fb6c8e2),
164170
// TODO(#95) unchanged in dark theme?
165171
star: const HSLColor.fromAHSL(0.5, 47, 1, 0.41).toColor(),
166172
unreadCountBadgeTextForChannel: Colors.white.withOpacity(0.9),
@@ -177,9 +183,11 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
177183
required this.mainBackground,
178184
required this.title,
179185
required this.channelColorSwatches,
186+
required this.atMentionMarker,
180187
required this.dmHeaderBg,
181188
required this.loginOrDivider,
182189
required this.loginOrDividerText,
190+
required this.sectionCollapseIcon,
183191
required this.star,
184192
required this.unreadCountBadgeTextForChannel,
185193
});
@@ -208,9 +216,11 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
208216
final ChannelColorSwatches channelColorSwatches;
209217

210218
// Not named variables in Figma; taken from older Figma drafts, or elsewhere.
219+
final Color atMentionMarker;
211220
final Color dmHeaderBg;
212221
final Color loginOrDivider; // TODO(#95) need proper dark-theme color (this is ad hoc)
213222
final Color loginOrDividerText; // TODO(#95) need proper dark-theme color (this is ad hoc)
223+
final Color sectionCollapseIcon;
214224
final Color star;
215225
final Color unreadCountBadgeTextForChannel;
216226

@@ -226,9 +236,11 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
226236
Color? mainBackground,
227237
Color? title,
228238
ChannelColorSwatches? channelColorSwatches,
239+
Color? atMentionMarker,
229240
Color? dmHeaderBg,
230241
Color? loginOrDivider,
231242
Color? loginOrDividerText,
243+
Color? sectionCollapseIcon,
232244
Color? star,
233245
Color? unreadCountBadgeTextForChannel,
234246
}) {
@@ -243,9 +255,11 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
243255
mainBackground: mainBackground ?? this.mainBackground,
244256
title: title ?? this.title,
245257
channelColorSwatches: channelColorSwatches ?? this.channelColorSwatches,
258+
atMentionMarker: atMentionMarker ?? this.atMentionMarker,
246259
dmHeaderBg: dmHeaderBg ?? this.dmHeaderBg,
247260
loginOrDivider: loginOrDivider ?? this.loginOrDivider,
248261
loginOrDividerText: loginOrDividerText ?? this.loginOrDividerText,
262+
sectionCollapseIcon: sectionCollapseIcon ?? this.sectionCollapseIcon,
249263
star: star ?? this.star,
250264
unreadCountBadgeTextForChannel: unreadCountBadgeTextForChannel ?? this.unreadCountBadgeTextForChannel,
251265
);
@@ -267,9 +281,11 @@ class DesignVariables extends ThemeExtension<DesignVariables> {
267281
mainBackground: Color.lerp(mainBackground, other.mainBackground, t)!,
268282
title: Color.lerp(title, other.title, t)!,
269283
channelColorSwatches: ChannelColorSwatches.lerp(channelColorSwatches, other.channelColorSwatches, t),
284+
atMentionMarker: Color.lerp(atMentionMarker, other.atMentionMarker, t)!,
270285
dmHeaderBg: Color.lerp(dmHeaderBg, other.dmHeaderBg, t)!,
271286
loginOrDivider: Color.lerp(loginOrDivider, other.loginOrDivider, t)!,
272287
loginOrDividerText: Color.lerp(loginOrDividerText, other.loginOrDividerText, t)!,
288+
sectionCollapseIcon: Color.lerp(sectionCollapseIcon, other.sectionCollapseIcon, t)!,
273289
star: Color.lerp(star, other.star, t)!,
274290
unreadCountBadgeTextForChannel: Color.lerp(unreadCountBadgeTextForChannel, other.unreadCountBadgeTextForChannel, t)!,
275291
);

0 commit comments

Comments
 (0)