Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Upcoming

🐞 Fixed

- Fixed `StreamMessageInput` throwing exception when a non-initialized `Channel` is used.

🔄 Changed

- Updated `just_audio` dependency to `">=0.9.38 <0.11.0"`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,20 +636,21 @@
}

final channel = StreamChannel.of(context).channel;
final messageInput = BetterStreamBuilder(
stream: channel.ownCapabilitiesStream.map(canSendOrUpdateMessage),
initialData: canSendOrUpdateMessage(channel.ownCapabilities),
builder: (context, enabled) {
// Allow the user to send messages if the user has the permission to
// send messages or if the user is editing a message.
if (enabled) {
return _buildAutocompleteMessageInput(context);
}

// Otherwise, show the no permission message.
return _buildNoPermissionMessage(context);
},
);
final messageInput = switch (_buildAutocompleteMessageInput(context)) {
final messageInput when channel.state != null => BetterStreamBuilder(
stream: channel.ownCapabilitiesStream.map(canSendOrUpdateMessage),
initialData: canSendOrUpdateMessage(channel.ownCapabilities),
builder: (context, enabled) {
// Allow the user to send messages if the user has the permission to
// send messages or if the user is editing a message.
if (enabled) return messageInput;

// Otherwise, show the no permission message.
return _buildNoPermissionMessage(context);

Check warning on line 649 in packages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart

View check run for this annotation

Codecov / codecov/patch

packages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart#L649

Added line #L649 was not covered by tests
},
),
final messageInput => messageInput,
};

final shadow = widget.shadow ?? _messageInputTheme.shadow;
final elevation = widget.elevation ?? _messageInputTheme.elevation;
Expand Down