Skip to content

Commit aac4c5c

Browse files
committed
action_sheet: Show channel name in channel action sheet
Fixes-partly: zulip#1533
1 parent e63b022 commit aac4c5c

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

lib/widgets/action_sheet.dart

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ void showChannelActionSheet(BuildContext context, {
475475
bool showTopicListButton = true,
476476
}) {
477477
final pageContext = PageRoot.contextOf(context);
478+
final zulipLocalizations = ZulipLocalizations.of(pageContext);
478479
final store = PerAccountStoreWidget.of(pageContext);
479480
final messageListPageState = MessageListPage.maybeAncestorOf(pageContext);
480481

@@ -502,7 +503,31 @@ void showChannelActionSheet(BuildContext context, {
502503
[UnsubscribeButton(pageContext: pageContext, channelId: channelId)],
503504
];
504505

505-
_showActionSheet(pageContext, buttonSections: buttonSections);
506+
Widget header;
507+
if (channel == null) {
508+
header = BottomSheetHeader(title: zulipLocalizations.unknownChannelName);
509+
} else {
510+
final channelIconColor = colorSwatchFor(context,
511+
store.subscriptions[channelId]).iconOnPlainBackground;
512+
final icon = iconDataForStream(channel);
513+
514+
header = BottomSheetHeader(
515+
buildTitle: (baseStyle) => Row(
516+
spacing: 4,
517+
mainAxisSize: MainAxisSize.min,
518+
// TODO(design): The vertical alignment of the stream privacy icon is a bit ad hoc.
519+
crossAxisAlignment: CrossAxisAlignment.center,
520+
children: [
521+
Icon(size: baseStyle.fontSize, color: channelIconColor, icon),
522+
Flexible(child: Text(style: baseStyle,
523+
channel.name)),
524+
]));
525+
}
526+
527+
_showActionSheet(pageContext,
528+
header: header,
529+
headerScrollable: false,
530+
buttonSections: buttonSections);
506531
}
507532

508533
class SubscribeButton extends ActionSheetMenuItemButton {

0 commit comments

Comments
 (0)