Skip to content

Commit c799aed

Browse files
committed
content [nfc]: Pull out child variable in MessageContent.build
For the edit-message feature, the Figma fades message content during the loading state: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=4026-8563&m=dev This refactor prepares for that.
1 parent e4a6758 commit c799aed

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/widgets/content.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,16 @@ class MessageContent extends StatelessWidget {
296296
@override
297297
Widget build(BuildContext context) {
298298
final content = this.content;
299+
300+
Widget child = switch (content) {
301+
ZulipContent() => BlockContentList(nodes: content.nodes),
302+
PollContent() => PollWidget(messageId: message.id, poll: content.poll),
303+
};
304+
299305
return InheritedMessage(message: message,
300306
child: DefaultTextStyle(
301307
style: ContentTheme.of(context).textStylePlainParagraph,
302-
child: switch (content) {
303-
ZulipContent() => BlockContentList(nodes: content.nodes),
304-
PollContent() => PollWidget(messageId: message.id, poll: content.poll),
305-
}));
308+
child: child));
306309
}
307310
}
308311

0 commit comments

Comments
 (0)