diff --git a/lib/widgets/message_list.dart b/lib/widgets/message_list.dart index 8ee6499a47..12ae8eb048 100644 --- a/lib/widgets/message_list.dart +++ b/lib/widgets/message_list.dart @@ -765,9 +765,12 @@ class DmRecipientHeader extends StatelessWidget { child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - const Padding( - padding: EdgeInsets.symmetric(horizontal: 6), - child: Icon(size: 16, ZulipIcons.user)), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + child: Icon( + color: _kRecipientHeaderTextColor, + size: 16, + ZulipIcons.user)), Expanded( child: Text(title, style: recipientHeaderTextStyle(context), diff --git a/test/flutter_checks.dart b/test/flutter_checks.dart index 68cc8eef89..c76d59843d 100644 --- a/test/flutter_checks.dart +++ b/test/flutter_checks.dart @@ -66,6 +66,7 @@ extension TextFieldChecks on Subject { extension TextStyleChecks on Subject { Subject get inherit => has((t) => t.inherit, 'inherit'); + Subject get color => has((t) => t.color, 'color'); Subject get fontSize => has((t) => t.fontSize, 'fontSize'); Subject get fontWeight => has((t) => t.fontWeight, 'fontWeight'); Subject get letterSpacing => has((t) => t.letterSpacing, 'letterSpacing'); diff --git a/test/widgets/message_list_test.dart b/test/widgets/message_list_test.dart index aef418041c..12e29eae11 100644 --- a/test/widgets/message_list_test.dart +++ b/test/widgets/message_list_test.dart @@ -1,7 +1,9 @@ import 'dart:convert'; import 'package:checks/checks.dart'; +import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter_gen/gen_l10n/zulip_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:http/http.dart' as http; @@ -399,6 +401,19 @@ void main() { tester.widget(find.text(zulipLocalizations.messageListGroupYouAndOthers( "${zulipLocalizations.unknownUserName}, ${eg.thirdUser.fullName}"))); }); + + testWidgets('icon color matches text color', (tester) async { + final zulipLocalizations = GlobalLocalizations.zulipLocalizations; + await setupMessageListPage(tester, messages: [ + eg.dmMessage(from: eg.otherUser, to: [eg.selfUser]), + ]); + await tester.pump(); + final textSpan = tester.renderObject(find.text( + zulipLocalizations.messageListGroupYouAndOthers( + zulipLocalizations.unknownUserName))).text; + final icon = tester.widget(find.byIcon(ZulipIcons.user)); + check(textSpan).style.isNotNull().color.equals(icon.color); + }); }); testWidgets('show dates', (tester) async {