Merge pull request #1030 from GetStream/live-event-improvements
feat(flutter): Live event integration improvements
This commit is contained in:
@@ -210,6 +210,8 @@ class StreamMessageInput extends StatefulWidget {
|
||||
this.enableSafeArea,
|
||||
this.elevation,
|
||||
this.shadow,
|
||||
this.autoCorrect,
|
||||
this.disableEmojiSuggestionsOverlay,
|
||||
}) : super(key: key);
|
||||
|
||||
/// List of options for showing overlays.
|
||||
@@ -329,6 +331,14 @@ class StreamMessageInput extends StatefulWidget {
|
||||
/// Shadow for the [StreamMessageInput] widget
|
||||
final BoxShadow? shadow;
|
||||
|
||||
/// Disable autoCorrect by passing false
|
||||
/// autoCorrect is enabled by default
|
||||
final bool? autoCorrect;
|
||||
|
||||
/// Disable the default emoji suggestions
|
||||
/// Enabled by default
|
||||
final bool? disableEmojiSuggestionsOverlay;
|
||||
|
||||
static bool _defaultValidator(Message message) =>
|
||||
message.text?.isNotEmpty == true || message.attachments.isNotEmpty;
|
||||
|
||||
@@ -360,6 +370,11 @@ 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;
|
||||
|
||||
RestorableMessageInputController? _controller;
|
||||
|
||||
MessageInputController get _effectiveController =>
|
||||
@@ -589,18 +604,19 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
||||
visible: _showCommandsOverlay,
|
||||
widget: _buildCommandsOverlayEntry(),
|
||||
),
|
||||
OverlayOptions(
|
||||
visible: _focusNode.hasFocus &&
|
||||
_effectiveController.text.isNotEmpty &&
|
||||
_effectiveController.baseOffset > 0 &&
|
||||
_effectiveController.text
|
||||
.substring(
|
||||
0,
|
||||
_effectiveController.baseOffset,
|
||||
)
|
||||
.contains(':'),
|
||||
widget: _buildEmojiOverlay(),
|
||||
),
|
||||
if (!_disableEmojiSuggestionsOverlay)
|
||||
OverlayOptions(
|
||||
visible: _focusNode.hasFocus &&
|
||||
_effectiveController.text.isNotEmpty &&
|
||||
_effectiveController.baseOffset > 0 &&
|
||||
_effectiveController.text
|
||||
.substring(
|
||||
0,
|
||||
_effectiveController.baseOffset,
|
||||
)
|
||||
.contains(':'),
|
||||
widget: _buildEmojiOverlay(),
|
||||
),
|
||||
OverlayOptions(
|
||||
visible: _showMentionsOverlay,
|
||||
widget: _buildMentionsOverlayEntry(),
|
||||
@@ -802,6 +818,7 @@ class StreamMessageInputState extends State<StreamMessageInput>
|
||||
textAlignVertical: TextAlignVertical.center,
|
||||
decoration: _getInputDecoration(context),
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
autocorrect: _autoCorrect,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user