feat(ui): add customOverlays to MessageInput

This commit is contained in:
Salvatore Giordano
2021-09-20 12:07:08 +02:00
parent bba1e817d3
commit a4efbbaa9f
3 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -5,11 +5,16 @@
- [[#668]](https://github.com/GetStream/stream-chat-flutter/issues/668): Fix `MessageInput` rendering errors in case
there are no actions available to show.
- [[#349]](https://github.com/GetStream/stream-chat-flutter/issues/349): Fix `MessageInput` attachment render overflow error.
- `MessageInput` overlays now follow the `MessageInput` focus.
🔄 Changed
- Animation curves changed from default `Curves.linear` to `Curves.easeOut` and `Curves.easeIn` for attachment controls.
✅ Added
- Added `MessageInput.customOverlays` property to add custom overlays to the `MessageInput`.
## 2.2.1
⚠️ Deprecated
@@ -109,7 +114,6 @@ upgraded with some goodies like `lerp` functions. Here's the full naming breakdo
- Fixed `MessageListView` not opening to the right initialMessage if `StreamChannel.initialMessageId` is set.
- Fixed null check errors when accessing `message.text` in `MessageWidget` and `MessageListView`; this occurred when
sending a message with no text.
- MessageInput can now be placed in any position on the screen.
## 2.1.2
@@ -192,6 +192,7 @@ class MessageInput extends StatefulWidget {
this.onAttachmentLimitExceed,
this.attachmentButtonBuilder,
this.commandButtonBuilder,
this.customOverlays = const [],
}) : assert(
initialMessage == null || editMessage == null,
"Can't provide both `initialMessage` and `editMessage`",
@@ -222,6 +223,9 @@ class MessageInput extends StatefulWidget {
/// Use this to transform the message
final FutureOr<Message> Function(Message)? preMessageSending;
/// List of custom overlays
final List<OverlayOption> customOverlays;
/// Parent message in case of a thread
final Message? parentMessage;
@@ -324,7 +328,6 @@ class MessageInputState extends State<MessageInput> {
bool _inputEnabled = true;
bool _commandEnabled = false;
bool _showCommandsOverlay = false;
bool _showEmojiOverlay = false;
bool _showMentionsOverlay = false;
Command? _chosenCommand;
@@ -1,6 +1,7 @@
export 'package:jiffy/jiffy.dart';
export 'package:stream_chat_flutter_core/stream_chat_flutter_core.dart';
export 'src/anchored_overlay.dart';
export 'src/attachment/attachment.dart';
export 'src/back_button.dart';
export 'src/channel_avatar.dart';