Merge branch 'develop' into hotfix/messageWidget
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
## Upcoming
|
||||
## 4.1.0
|
||||
|
||||
✅ Added
|
||||
|
||||
- [[#1119]](https://github.com/GetStream/stream-chat-flutter/issues/1119) Added an option to disable mentions overlay in `StreamMessageInput`
|
||||
- Deprecated `disableEmojiSuggestionsOverlay` in favor of `enableEmojiSuggestionsOverlay` in `StreamMessageInput`
|
||||
|
||||
🐞 Fixed
|
||||
|
||||
@@ -7,6 +12,10 @@
|
||||
- Fixed message widget thread indicator in reverse mode.
|
||||
- [[#1044]](https://github.com/GetStream/stream-chat-flutter/issues/1044): Refactor StreamMessageWidget bottom row to use Text.rich.
|
||||
|
||||
🔄 Changed
|
||||
|
||||
- Removed `isOwner` condition from `ChannelBottomSheet` and `StreamChannelInfoBottomSheet` for delete option tile.
|
||||
|
||||
## 4.0.1
|
||||
|
||||
- Minor fixes
|
||||
|
||||
@@ -33,7 +33,6 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
|
||||
final userAsMember = members
|
||||
.firstWhere((e) => e.user?.id == _streamChatState.currentUser?.id);
|
||||
final isOwner = userAsMember.role == 'owner';
|
||||
|
||||
return Material(
|
||||
color: _streamChatThemeData.colorTheme.barsBg,
|
||||
@@ -179,9 +178,8 @@ class _ChannelBottomSheetState extends State<ChannelBottomSheet> {
|
||||
});
|
||||
},
|
||||
),
|
||||
if (isOwner &&
|
||||
channel.ownCapabilities
|
||||
.contains(PermissionType.deleteChannel))
|
||||
if (channel.ownCapabilities
|
||||
.contains(PermissionType.deleteChannel))
|
||||
StreamOptionListTile(
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
|
||||
@@ -207,8 +207,10 @@ class StreamMessageInput extends StatefulWidget {
|
||||
this.enableSafeArea,
|
||||
this.elevation,
|
||||
this.shadow,
|
||||
this.autoCorrect,
|
||||
this.disableEmojiSuggestionsOverlay,
|
||||
this.autoCorrect = true,
|
||||
this.disableEmojiSuggestionsOverlay = false,
|
||||
this.enableEmojiSuggestionsOverlay = true,
|
||||
this.enableMentionsOverlay = true,
|
||||
}) : super(key: key);
|
||||
|
||||
/// List of options for showing overlays.
|
||||
@@ -327,11 +329,20 @@ class StreamMessageInput extends StatefulWidget {
|
||||
|
||||
/// Disable autoCorrect by passing false
|
||||
/// autoCorrect is enabled by default
|
||||
final bool? autoCorrect;
|
||||
final bool autoCorrect;
|
||||
|
||||
/// Disable the default emoji suggestions
|
||||
/// Enabled by default
|
||||
final bool? disableEmojiSuggestionsOverlay;
|
||||
@Deprecated('Please use enableEmojiSuggestionsOverlay')
|
||||
final bool disableEmojiSuggestionsOverlay;
|
||||
|
||||
/// Disable the default emoji suggestions by passing `false`
|
||||
/// Enabled by default
|
||||
final bool enableEmojiSuggestionsOverlay;
|
||||
|
||||
/// Disable the mentions overlay by passing false
|
||||
/// Enabled by default
|
||||
final bool enableMentionsOverlay;
|
||||
|
||||
static bool _defaultValidator(Message message) =>
|
||||
message.text?.isNotEmpty == true || message.attachments.isNotEmpty;
|
||||
@@ -364,11 +375,6 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
||||
bool get _isEditing =>
|
||||
_effectiveController.value.status != MessageSendingStatus.sending;
|
||||
|
||||
bool get _autoCorrect => widget.autoCorrect ?? true;
|
||||
|
||||
bool get _disableEmojiSuggestionsOverlay =>
|
||||
widget.disableEmojiSuggestionsOverlay ?? false;
|
||||
|
||||
StreamRestorableMessageInputController? _controller;
|
||||
|
||||
StreamMessageInputController get _effectiveController =>
|
||||
@@ -598,7 +604,8 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
||||
visible: _showCommandsOverlay,
|
||||
widget: _buildCommandsOverlayEntry(),
|
||||
),
|
||||
if (!_disableEmojiSuggestionsOverlay)
|
||||
if (widget.enableEmojiSuggestionsOverlay &&
|
||||
!widget.disableEmojiSuggestionsOverlay)
|
||||
OverlayOptions(
|
||||
visible: _focusNode.hasFocus &&
|
||||
_effectiveController.text.isNotEmpty &&
|
||||
@@ -611,10 +618,11 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
||||
.contains(':'),
|
||||
widget: _buildEmojiOverlay(),
|
||||
),
|
||||
OverlayOptions(
|
||||
visible: _showMentionsOverlay,
|
||||
widget: _buildMentionsOverlayEntry(),
|
||||
),
|
||||
if (widget.enableMentionsOverlay)
|
||||
OverlayOptions(
|
||||
visible: _showMentionsOverlay,
|
||||
widget: _buildMentionsOverlayEntry(),
|
||||
),
|
||||
...widget.customOverlays,
|
||||
],
|
||||
child: child,
|
||||
@@ -813,7 +821,7 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
||||
textAlignVertical: TextAlignVertical.center,
|
||||
decoration: _getInputDecoration(context),
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
autocorrect: _autoCorrect,
|
||||
autocorrect: widget.autoCorrect,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -59,10 +59,6 @@ class StreamChannelInfoBottomSheet extends StatelessWidget {
|
||||
|
||||
final members = channel.state?.members ?? [];
|
||||
|
||||
final isOwner = members.any(
|
||||
(it) => it.user?.id == currentUser?.id && it.role == 'owner',
|
||||
);
|
||||
|
||||
// remove current user in case it's 1-1 conversation
|
||||
if (isOneToOneChannel) {
|
||||
members.removeWhere((it) => it.user?.id == currentUser?.id);
|
||||
@@ -153,7 +149,7 @@ class StreamChannelInfoBottomSheet extends StatelessWidget {
|
||||
),
|
||||
onTap: onLeaveChannelTap,
|
||||
),
|
||||
if (isOwner)
|
||||
if (channel.ownCapabilities.contains(PermissionType.deleteChannel))
|
||||
StreamOptionListTile(
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: stream_chat_flutter
|
||||
homepage: https://github.com/GetStream/stream-chat-flutter
|
||||
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
||||
version: 4.0.1
|
||||
version: 4.1.0
|
||||
repository: https://github.com/GetStream/stream-chat-flutter
|
||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||
|
||||
@@ -36,7 +36,7 @@ dependencies:
|
||||
rxdart: ^0.27.0
|
||||
share_plus: ^4.0.1
|
||||
shimmer: ^2.0.0
|
||||
stream_chat_flutter_core: ^4.0.1
|
||||
stream_chat_flutter_core: ^4.1.0
|
||||
substring_highlight: ^1.0.26
|
||||
url_launcher: ^6.1.0
|
||||
video_player: ^2.1.0
|
||||
|
||||
Reference in New Issue
Block a user