feat(ui): add support for StreamMessageInput.contentInsertionConfiguration.

Signed-off-by: xsahil03x <[email protected]>
(cherry picked from commit bdc85b4873)
This commit is contained in:
Sahil Kumar
2023-07-18 16:35:35 +05:30
parent 531b79b9ff
commit c1c4b9584a
2 changed files with 14 additions and 0 deletions
@@ -147,6 +147,7 @@ class StreamMessageInput extends StatefulWidget {
_defaultClearQuotedMessageKeyPredicate,
this.ogPreviewFilter = _defaultOgPreviewFilter,
this.hintGetter = _defaultHintGetter,
this.contentInsertionConfiguration,
});
/// The predicate used to send a message on desktop/web
@@ -340,6 +341,9 @@ class StreamMessageInput extends StatefulWidget {
/// Returns the hint text for the message input.
final HintGetter hintGetter;
/// {@macro flutter.widgets.editableText.contentInsertionConfiguration}
final ContentInsertionConfiguration? contentInsertionConfiguration;
static String? _defaultHintGetter(
BuildContext context,
HintType type,
@@ -904,6 +908,8 @@ class StreamMessageInputState extends State<StreamMessageInput>
decoration: _getInputDecoration(context),
textCapitalization: widget.textCapitalization,
autocorrect: widget.autoCorrect,
contentInsertionConfiguration:
widget.contentInsertionConfiguration,
),
),
),
@@ -120,6 +120,7 @@ class StreamMessageTextField extends StatefulWidget {
this.restorationId,
this.scribbleEnabled = true,
this.enableIMEPersonalizedLearning = true,
this.contentInsertionConfiguration,
}) : assert(obscuringCharacter.length == 1, ''),
smartDashesType = smartDashesType ??
(obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
@@ -526,6 +527,9 @@ class StreamMessageTextField extends StatefulWidget {
/// {@macro flutter.services.TextInputConfiguration.enableIMEPersonalizedLearning}
final bool enableIMEPersonalizedLearning;
/// {@macro flutter.widgets.editableText.contentInsertionConfiguration}
final ContentInsertionConfiguration? contentInsertionConfiguration;
@override
_StreamMessageTextFieldState createState() => _StreamMessageTextFieldState();
@@ -622,6 +626,9 @@ class StreamMessageTextField extends StatefulWidget {
properties.add(DiagnosticsProperty<bool>(
'enableIMEPersonalizedLearning', enableIMEPersonalizedLearning,
defaultValue: true));
properties.add(DiagnosticsProperty<ContentInsertionConfiguration>(
'contentInsertionConfiguration', contentInsertionConfiguration,
defaultValue: null));
}
}
@@ -727,6 +734,7 @@ class _StreamMessageTextFieldState extends State<StreamMessageTextField>
restorationId: widget.restorationId,
scribbleEnabled: widget.scribbleEnabled,
enableIMEPersonalizedLearning: widget.enableIMEPersonalizedLearning,
contentInsertionConfiguration: widget.contentInsertionConfiguration,
);
@override