Skip to content

Commit 9e85cb4

Browse files
committed
fix padding stream message action
1 parent f8878d6 commit 9e85cb4

File tree

2 files changed

+51
-37
lines changed

2 files changed

+51
-37
lines changed
-234 Bytes
Loading

packages/docs_screenshots/test/message_list/message_widget_test.dart

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ Widget _buildMessageScaffold({
4646
);
4747
}
4848

49-
void _setupBasicChannel(MockClient client, MockClientState clientState, MockChannel channel, MockChannelState channelState) {
49+
void _setupBasicChannel(
50+
MockClient client,
51+
MockClientState clientState,
52+
MockChannel channel,
53+
MockChannelState channelState,
54+
) {
5055
setupMockChannel(
5156
client: client,
5257
clientState: clientState,
@@ -89,42 +94,51 @@ void main() {
8994
return _buildMessageScaffold(
9095
client: client,
9196
channel: channel,
92-
child: StreamMessageActionsModal(
93-
message: message,
94-
showReactionPicker: true,
95-
messageWidget: StreamMessageWidget(message: message),
96-
messageActions: [
97-
StreamContextMenuAction(
98-
value: const _ReplyAction(),
99-
leading: const Icon(Icons.reply),
100-
label: const Text('Reply'),
101-
),
102-
StreamContextMenuAction(
103-
value: const _ThreadReplyAction(),
104-
leading: const Icon(Icons.comment_outlined),
105-
label: const Text('Thread Reply'),
106-
),
107-
StreamContextMenuAction(
108-
value: const _EditAction(),
109-
leading: const Icon(Icons.edit_outlined),
110-
label: const Text('Edit Message'),
111-
),
112-
StreamContextMenuAction(
113-
value: const _CopyAction(),
114-
leading: const Icon(Icons.copy_outlined),
115-
label: const Text('Copy Message'),
116-
),
117-
StreamContextMenuAction(
118-
value: const _PinAction(),
119-
leading: const Icon(Icons.push_pin_outlined),
120-
label: const Text('Pin to Conversation'),
121-
),
122-
StreamContextMenuAction.destructive(
123-
value: const _DeleteAction(),
124-
leading: const Icon(Icons.delete_outlined),
125-
label: const Text('Delete Message'),
126-
),
127-
],
97+
child: Builder(
98+
builder: (context) {
99+
const effectiveAvatarSize = StreamAvatarSize.md;
100+
final effectiveSpacing = context.streamSpacing.md + context.streamSpacing.xs;
101+
final leadingInset = effectiveAvatarSize.value + effectiveSpacing;
102+
103+
return StreamMessageActionsModal(
104+
message: message,
105+
showReactionPicker: true,
106+
leadingInset: leadingInset,
107+
messageWidget: StreamMessageWidget(message: message),
108+
messageActions: [
109+
StreamContextMenuAction(
110+
value: const _ReplyAction(),
111+
leading: const Icon(Icons.reply),
112+
label: const Text('Reply'),
113+
),
114+
StreamContextMenuAction(
115+
value: const _ThreadReplyAction(),
116+
leading: const Icon(Icons.comment_outlined),
117+
label: const Text('Thread Reply'),
118+
),
119+
StreamContextMenuAction(
120+
value: const _EditAction(),
121+
leading: const Icon(Icons.edit_outlined),
122+
label: const Text('Edit Message'),
123+
),
124+
StreamContextMenuAction(
125+
value: const _CopyAction(),
126+
leading: const Icon(Icons.copy_outlined),
127+
label: const Text('Copy Message'),
128+
),
129+
StreamContextMenuAction(
130+
value: const _PinAction(),
131+
leading: const Icon(Icons.push_pin_outlined),
132+
label: const Text('Pin to Conversation'),
133+
),
134+
StreamContextMenuAction.destructive(
135+
value: const _DeleteAction(),
136+
leading: const Icon(Icons.delete_outlined),
137+
label: const Text('Delete Message'),
138+
),
139+
],
140+
);
141+
},
128142
),
129143
);
130144
},

0 commit comments

Comments
 (0)