Skip to content

Commit f7feabf

Browse files
committed
msglist: Make DM recipient header touchable
Fixes: #142
1 parent baa44cb commit f7feabf

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

lib/widgets/message_list.dart

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,22 @@ class DmRecipientHeader extends StatelessWidget {
315315

316316
@override
317317
Widget build(BuildContext context) {
318-
return Align(
319-
alignment: Alignment.centerLeft,
320-
child: RecipientHeaderChevronContainer(
321-
color: _kDmRecipientHeaderColor,
322-
child: const Text("Direct message", // TODO DM recipient headers
323-
style: TextStyle(color: Colors.white))));
318+
return GestureDetector(
319+
behavior: HitTestBehavior.translucent,
320+
onTap: () {
321+
final store = PerAccountStoreWidget.of(context);
322+
final narrow = DmNarrow(
323+
allRecipientIds: message.allRecipientIds.toList(growable: false),
324+
selfUserId: store.account.userId);
325+
Navigator.push(context,
326+
MessageListPage.buildRoute(context: context, narrow: narrow));
327+
},
328+
child: Align(
329+
alignment: Alignment.centerLeft,
330+
child: RecipientHeaderChevronContainer(
331+
color: _kDmRecipientHeaderColor,
332+
child: const Text("Direct message", // TODO DM recipient headers
333+
style: TextStyle(color: Colors.white)))));
324334
}
325335
}
326336

0 commit comments

Comments
 (0)