@@ -370,36 +370,54 @@ class MessageListAppBarTitle extends StatelessWidget {
370
370
case ChannelNarrow (: var streamId):
371
371
final store = PerAccountStoreWidget .of (context);
372
372
final stream = store.streams[streamId];
373
- return _buildStreamRow (context, stream: stream);
374
-
375
- case TopicNarrow (: var streamId, : var topic):
376
- final store = PerAccountStoreWidget .of (context);
377
- final stream = store.streams[streamId];
373
+ final alignment = willCenterTitle
374
+ ? Alignment .center
375
+ : AlignmentDirectional .centerStart;
378
376
return SizedBox (
379
377
width: double .infinity,
380
378
child: GestureDetector (
381
379
behavior: HitTestBehavior .translucent,
382
380
onLongPress: () {
383
- final someMessage = MessageListPage .ancestorOf (context)
384
- .model? .messages.firstOrNull;
385
- // If someMessage is null, the topic action sheet won't have a
386
- // resolve/unresolve button. That seems OK; in that case we're
387
- // either still fetching messages (and the user can reopen the
388
- // sheet after that finishes) or there aren't any messages to
389
- // act on anyway.
390
- assert (someMessage == null || narrow.containsMessage (someMessage));
391
- showTopicActionSheet (context,
392
- channelId: streamId,
393
- topic: topic,
394
- someMessageIdInTopic: someMessage? .id);
381
+ showChannelActionSheet (context, channelId: streamId);
395
382
},
396
- child: Column (
397
- crossAxisAlignment: willCenterTitle ? CrossAxisAlignment .center
398
- : CrossAxisAlignment .start,
399
- children: [
400
- _buildStreamRow (context, stream: stream),
401
- _buildTopicRow (context, stream: stream, topic: topic),
402
- ])));
383
+ child: Align (alignment: alignment,
384
+ child: _buildStreamRow (context, stream: stream))));
385
+
386
+ case TopicNarrow (: var streamId, : var topic):
387
+ final store = PerAccountStoreWidget .of (context);
388
+ final stream = store.streams[streamId];
389
+ final alignment = willCenterTitle
390
+ ? Alignment .center
391
+ : AlignmentDirectional .centerStart;
392
+ return Column (
393
+ crossAxisAlignment: CrossAxisAlignment .stretch,
394
+ children: [
395
+ GestureDetector (
396
+ behavior: HitTestBehavior .translucent,
397
+ onLongPress: () {
398
+ showChannelActionSheet (context, channelId: streamId);
399
+ },
400
+ child: Align (alignment: alignment,
401
+ child: _buildStreamRow (context, stream: stream))),
402
+ GestureDetector (
403
+ behavior: HitTestBehavior .translucent,
404
+ onLongPress: () {
405
+ final someMessage = MessageListPage .ancestorOf (context)
406
+ .model? .messages.firstOrNull;
407
+ // If someMessage is null, the topic action sheet won't have a
408
+ // resolve/unresolve button. That seems OK; in that case we're
409
+ // either still fetching messages (and the user can reopen the
410
+ // sheet after that finishes) or there aren't any messages to
411
+ // act on anyway.
412
+ assert (someMessage == null || narrow.containsMessage (someMessage));
413
+ showTopicActionSheet (context,
414
+ channelId: streamId,
415
+ topic: topic,
416
+ someMessageIdInTopic: someMessage? .id);
417
+ },
418
+ child: Align (alignment: alignment,
419
+ child: _buildTopicRow (context, stream: stream, topic: topic))),
420
+ ]);
403
421
404
422
case DmNarrow (: var otherRecipientIds):
405
423
final store = PerAccountStoreWidget .of (context);
@@ -1061,6 +1079,7 @@ class StreamMessageRecipientHeader extends StatelessWidget {
1061
1079
onTap: () => Navigator .push (context,
1062
1080
MessageListPage .buildRoute (context: context,
1063
1081
narrow: ChannelNarrow (message.streamId))),
1082
+ onLongPress: () => showChannelActionSheet (context, channelId: message.streamId),
1064
1083
child: Row (
1065
1084
crossAxisAlignment: CrossAxisAlignment .center,
1066
1085
children: [
0 commit comments