Skip to content

Commit 0aeca52

Browse files
committed
msglist: Make DM recipient header icon (ZulipIcons.user) match text color
As it does in the Figma. (Before, the color was the Material constant kDefaultIconDarkColor, which is Color(0xDD000000).)
1 parent 3b5f5ca commit 0aeca52

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

lib/widgets/message_list.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,12 @@ class DmRecipientHeader extends StatelessWidget {
765765
child: Row(
766766
crossAxisAlignment: CrossAxisAlignment.center,
767767
children: [
768-
const Padding(
769-
padding: EdgeInsets.symmetric(horizontal: 6),
770-
child: Icon(size: 16, ZulipIcons.user)),
768+
Padding(
769+
padding: const EdgeInsets.symmetric(horizontal: 6),
770+
child: Icon(
771+
color: _kRecipientHeaderTextColor,
772+
size: 16,
773+
ZulipIcons.user)),
771774
Expanded(
772775
child: Text(title,
773776
style: recipientHeaderTextStyle(context),

test/flutter_checks.dart

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extension TextFieldChecks on Subject<TextField> {
6666

6767
extension TextStyleChecks on Subject<TextStyle> {
6868
Subject<bool> get inherit => has((t) => t.inherit, 'inherit');
69+
Subject<Color?> get color => has((t) => t.color, 'color');
6970
Subject<double?> get fontSize => has((t) => t.fontSize, 'fontSize');
7071
Subject<FontWeight?> get fontWeight => has((t) => t.fontWeight, 'fontWeight');
7172
Subject<double?> get letterSpacing => has((t) => t.letterSpacing, 'letterSpacing');

test/widgets/message_list_test.dart

+15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import 'dart:convert';
22

33
import 'package:checks/checks.dart';
4+
import 'package:collection/collection.dart';
45
import 'package:flutter/material.dart';
6+
import 'package:flutter/rendering.dart';
57
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart';
68
import 'package:flutter_test/flutter_test.dart';
79
import 'package:http/http.dart' as http;
@@ -399,6 +401,19 @@ void main() {
399401
tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers(
400402
"${zulipLocalizations.unknownUserName}, ${eg.thirdUser.fullName}")));
401403
});
404+
405+
testWidgets('icon color matches text color', (tester) async {
406+
final zulipLocalizations = GlobalLocalizations.zulipLocalizations;
407+
await setupMessageListPage(tester, messages: [
408+
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]),
409+
]);
410+
await tester.pump();
411+
final textSpan = tester.renderObject<RenderParagraph>(find.text(
412+
zulipLocalizations.messageListGroupYouAndOthers(
413+
zulipLocalizations.unknownUserName))).text;
414+
final icon = tester.widget<Icon>(find.byIcon(ZulipIcons.user));
415+
check(textSpan).style.isNotNull().color.equals(icon.color);
416+
});
402417
});
403418

404419
testWidgets('show dates', (tester) async {

0 commit comments

Comments
 (0)