@@ -13,12 +13,14 @@ import '../api/route/channels.dart';
1313import '../api/route/messages.dart' ;
1414import '../generated/l10n/zulip_localizations.dart' ;
1515import '../model/binding.dart' ;
16+ import '../model/content.dart' ;
1617import '../model/emoji.dart' ;
1718import '../model/internal_link.dart' ;
1819import '../model/narrow.dart' ;
1920import 'actions.dart' ;
2021import 'color.dart' ;
2122import 'compose_box.dart' ;
23+ import 'content.dart' ;
2224import 'dialog.dart' ;
2325import 'emoji.dart' ;
2426import 'emoji_reaction.dart' ;
@@ -33,6 +35,7 @@ import 'topic_list.dart';
3335
3436void _showActionSheet (
3537 BuildContext pageContext, {
38+ Widget ? header,
3639 required List <Widget > optionButtons,
3740}) {
3841 // Could omit this if we need _showActionSheet outside a per-account context.
@@ -57,15 +60,31 @@ void _showActionSheet(
5760 child: Column (
5861 mainAxisSize: MainAxisSize .min,
5962 children: [
60- SizedBox (height: 8 ),
63+ if (header != null )
64+ Flexible (
65+ // TODO(upstream) Enforce a flex ratio (e.g. 1:3)
66+ // only when the header height plus the buttons' height
67+ // exceeds available space. Otherwise let one or the other
68+ // grow to fill available space even if it breaks the ratio.
69+ // Needs support for separate properties like `flex-grow`
70+ // and `flex-shrink`.
71+ flex: 1 ,
72+ child: InsetShadowBox (
73+ top: 8 , bottom: 8 ,
74+ color: designVariables.bgContextMenu,
75+ child: SingleChildScrollView (
76+ padding: EdgeInsets .symmetric (vertical: 8 ),
77+ child: header)))
78+ else
79+ SizedBox (height: 8 ),
6180 Flexible (
81+ flex: 3 ,
6282 child: Padding (
6383 padding: const EdgeInsets .fromLTRB (16 , 0 , 16 , 0 ),
6484 child: Column (
6585 crossAxisAlignment: CrossAxisAlignment .stretch,
6686 mainAxisSize: MainAxisSize .min,
6787 children: [
68- // TODO(#217): show message text
6988 Flexible (child: InsetShadowBox (
7089 top: 8 , bottom: 8 ,
7190 color: designVariables.bgContextMenu,
@@ -621,7 +640,42 @@ void showMessageActionSheet({required BuildContext context, required Message mes
621640 EditButton (message: message, pageContext: pageContext),
622641 ];
623642
624- _showActionSheet (pageContext, optionButtons: optionButtons);
643+ _showActionSheet (pageContext,
644+ optionButtons: optionButtons,
645+ header: _MessageActionSheetHeader (message: message));
646+ }
647+
648+ class _MessageActionSheetHeader extends StatelessWidget {
649+ const _MessageActionSheetHeader ({required this .message});
650+
651+ final Message message;
652+
653+ @override
654+ Widget build (BuildContext context) {
655+ final designVariables = DesignVariables .of (context);
656+
657+ // TODO this seems to lose the hero animation when opening an image;
658+ // investigate.
659+ // TODO should we close the sheet before opening a narrow link?
660+ // On popping the pushed narrow route, the sheet is still open.
661+
662+ return Container (
663+ // TODO(#647) use different color for highlighted messages
664+ // TODO(#681) use different color for DM messages
665+ color: designVariables.bgMessageRegular,
666+ padding: EdgeInsets .symmetric (vertical: 4 ),
667+ child: Column (
668+ spacing: 4 ,
669+ children: [
670+ SenderRow (message: message,
671+ timestampDisplay: MessageTimestampDisplay .full),
672+ Padding (
673+ padding: const EdgeInsets .symmetric (horizontal: 16 ),
674+ // TODO(#10) offer text selection; the Figma asks for it here:
675+ // https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=3483-30210&m=dev
676+ child: MessageContent (message: message, content: parseMessageContent (message))),
677+ ]));
678+ }
625679}
626680
627681abstract class MessageActionSheetMenuItemButton extends ActionSheetMenuItemButton {
0 commit comments