onPressed property
Callback gets triggered when the action button is pressed.
Defaults to null
.
Example:
@override
Widget build(BuildContext context) {
return SfAIAssistView(
actionButton: AssistActionButton(
onPressed: (String newMessage) {
setState(() {
_messages.add(
AssistMessage.request(
data: newMessage,
),
);
});
},
),
);
}
Implementation
@override
final ValueChanged<String>? onPressed;