Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions Flutter/ai-assistview/action-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@ The [`actionButton`](https://pub.dev/documentation/syncfusion_flutter_chat/lates

The default action button is a send button. Pressing or clicking this button triggers a callback, allowing the user to request a response to their composed message from their preferred AI service.

If [`AssistComposer.builder`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistComposer/AssistComposer.builder.html) is used, the parameter of onPressed will always be an empty string.

If [`AssistActionButton.onPressed`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/onPressed.html) is null, the action button will always be disabled.

If the default composer is disabled, the action button will also be disabled.

If no composer is added (by specifying the composer as null), the action button will always be enabled.
If the [`AssistComposer.builder`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistComposer/AssistComposer.builder.html) is used, the onPressed parameter will always receive an empty string. When the [`onPressed`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/onPressed.html) property of AssistActionButton is set to null, the action button remains disabled. Additionally, if the default composer is disabled, the action button will also be disabled. However, if no composer is added by setting the composer property to null, the action button will always remain enabled.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="8" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -54,7 +48,7 @@ If no composer is added (by specifying the composer as null), the action button
The [child](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/child.html) property allows you to define a custom widget consisting of one or more interactive elements to serve as action buttons, such as a send button, microphone icon for voice input, file attachment button, or other interactive widgets.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -83,7 +77,7 @@ The [child](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_
It is a callback that is invoked whenever the action button is pressed. Since the assist widget does not rebuild itself to update the newly composed message, it provides the default text from the composer as a parameter. The user can create a message object and include it in the existing [`messages`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/SfAIAssistView/messages.html) list by rebuilding the assist widget to add the newly composed message to the conversational area.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="22" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -125,7 +119,7 @@ It is a callback that is invoked whenever the action button is pressed. Since th
The [`tooltip`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/tooltip.html) text describes the button's action when pressed. It is displayed when the user long-presses on touch devices or hovers the mouse over it on desktop devices. By default, it is set to `null`, so no tooltip is shown.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -162,7 +156,7 @@ The [`hoverColor`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/
The [`splashColor`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/splashColor.html) property is the splash color of the button's InkWell. The default color is set to `colorScheme.primary.withOpacity(0.86)`.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9 10 11 12 13" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -199,7 +193,7 @@ The [`hoverElevation`](https://pub.dev/documentation/syncfusion_flutter_chat/lat
The [`highlightElevation`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/highlightElevation.html) property determines the elevation when the button is pressed. Defaults to `0.0`.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9 10 11 12" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -229,7 +223,7 @@ The [`highlightElevation`](https://pub.dev/documentation/syncfusion_flutter_chat
The [`mouseCursor`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/mouseCursor.html) property defines the type of cursor that appears when hovering over the button. It can be set to different values to customize the cursor shape (e.g., [`SystemMouseCursors.click`](https://api.flutter.dev/flutter/services/SystemMouseCursors/click-constant.html), [`SystemMouseCursors.forbidden`](https://api.flutter.dev/flutter/services/SystemMouseCursors/forbidden-constant.html), etc.). If not specified, the default cursor will be used.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -258,7 +252,7 @@ The [`mouseCursor`](https://pub.dev/documentation/syncfusion_flutter_chat/latest
The [`shape`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/shape.html) property sets the shape of the button's border, such as rounded or circular. By default, it is set to `RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0)))`.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down Expand Up @@ -294,7 +288,7 @@ The [`shape`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assis
The [`margin`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/margin.html) property defines the space inside the button between its border and the content. By default, it is set to `EdgeInsetsDirectional.only(start: 8.0)`.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand All @@ -321,7 +315,7 @@ The [`margin`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assi
The [`size`](https://pub.dev/documentation/syncfusion_flutter_chat/latest/assist_view/AssistActionButton/size.html) property specifies the width and height of the button. By default, it is set to `Size.square(40.0)`.

{% tabs %}
{% highlight dart %}
{% highlight dart hl_lines="9" %}

final List<AssistMessage> _messages = <AssistMessage>[];

Expand Down
Loading