ChatActionButton class
A customizable action button for chat interactions.
The ChatActionButton allows extensive customizations, including appearance, size, and behavior.
Example:
@override
Widget build(BuildContext context) {
return SfChat(
actionButton: ChatActionButton(
onPressed: (String newMessage) {
setState(() {
_messages.add(
ChatMessage(
text: newMessage,
time: DateTime.now(),
author: const ChatAuthor(
id: '123-001',
name: 'Chat A',
),
),
);
});
},
),
);
}
Constructors
-
ChatActionButton({Widget? child, String? tooltip, Color? foregroundColor, Color? backgroundColor, Color? focusColor, Color? hoverColor, Color? splashColor, double? elevation, double? focusElevation, double? hoverElevation, double? highlightElevation, MouseCursor? mouseCursor, ShapeBorder? shape, EdgeInsetsGeometry padding = const EdgeInsetsDirectional.only(start: 8.0), Size size = const Size.square(40.0), required ValueChanged<
String> ? onPressed}) -
Creates a ChatActionButton with the given parameters.
const
Properties
- backgroundColor → Color?
-
Background color of the button.
final
- child → Widget?
-
Widget displayed inside the button.
final
- elevation → double?
-
Depth of the button's shadow, which influences its appearance.
final
- focusColor → Color?
-
Color of the button while it is focused.
final
- focusElevation → double?
-
Depth of the button's shadow while focused.
final
- foregroundColor → Color?
-
Color of the button's content (icons or text).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightElevation → double?
-
Depth of the button's shadow when highlighted.
final
- hoverColor → Color?
-
Color of the button while the mouse is hovering over it.
final
- hoverElevation → double?
-
Depth of the button's shadow when the mouse hovers over it.
final
- mouseCursor → MouseCursor?
-
Customizes the cursor that appears when you hover over the button.
final
-
onPressed
→ ValueChanged<
String> ? -
A callback function that is called whenever the button is pressed. This
parameter is a function that receives a
String
argument representing the new message. It is Invoked when the button is pressed.final - padding → EdgeInsetsGeometry
-
Customizes the padding around the button’s child widget.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → ShapeBorder?
-
Shape of the button border.
final
- size → Size
-
Size of the button.
final
- splashColor → Color?
-
Color of the splash effect generated when the button is pressed.
final
- tooltip → String?
-
Text displayed when the button is hovered over or long pressed.
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