AssistComposer class
Represents a composer for the assist message.
The AssistComposer allows customization of text input areas, including text style, line limits, and decoration. It can also be initialized with a custom builder.
Example with default composer:
@override
Widget build(BuildContext context) {
return SfAIAssistView(
composer: AssistComposer(
textStyle: TextStyle(fontSize: 16.0, color: Colors.black),
minLines: 2,
maxLines: 5,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(42.0)))),
hintText: 'Type a message...',
),
padding: const EdgeInsets.only(top: 16.0),
)
);
}
Example with custom Composer:
@override
Widget build(BuildContext context) {
return SfAIAssistView(
composer: AssistComposer.builder(
builder: (context) => CustomAssistInputWidget(),
padding: const EdgeInsets.only(top: 16.0),
)
);
}
Constructors
- AssistComposer({TextStyle? textStyle, int minLines = 1, int maxLines = 6, InputDecoration? decoration = const InputDecoration(), EdgeInsetsGeometry padding = const EdgeInsets.only(top: 24.0)})
-
Creates a AssistComposer with the given
textStyle
, line limits,decoration
, andpadding
.const - AssistComposer.builder({required WidgetBuilder? builder, EdgeInsetsGeometry padding = const EdgeInsets.only(top: 24.0)})
-
Named constructor to create a composer using a custom widget.
const
Properties
- builder → WidgetBuilder?
-
The builder to have the custom widget as composer.
final
- decoration → InputDecoration?
-
The decoration property specifies the visual styling and layout for the
composer input text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxLines → int
-
The maxLines property defines the maximum number of lines the composer
can occupy.
final
- minLines → int
-
The minLines property sets the minimum number of lines the composer
will occupy.
final
- padding → EdgeInsetsGeometry
-
The padding around the composer.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textStyle → TextStyle?
-
The textStyle property defines the style of the composer input text.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited