LMChatFloatingActionButton
File location
floating_action_button.dart
LMChatFloatingActionButton
is a customizable floating action button for the chat interface. It supports toggling between collapsed and expanded states, along with text and icon customization.
Properties
isCollapsed
(bool
)
Determines if the button is in a collapsed state.text
(String?
)
Optional text displayed inside the button.onTap
(VoidCallback?
)
Callback function triggered on button tap.
Note: These properties are only a subset. More can be found inside the widget class.
Styling
LMChatFloatingActionButtonStyle
File location
floating_action_button.dart
LMChatFloatingActionButtonStyle
defines the appearance of the floating action button, including size, colors, and animation behavior.
Property | Type | Description | Required | Default |
---|---|---|---|---|
backgroundColor | Color? | Background color of the button | No | Inherited theme |
collapsedHeight | double? | Height when the button is collapsed | No | None |
expandedWidth | double? | Width when the button is expanded | No | None |
Note: These properties are only a subset. More can be found inside the style class.
Example Usage
final floatingActionButton = LMChatFloatingActionButton(
isCollapsed: false,
text: 'New',
onTap: () => print('FAB tapped'),
style: LMChatFloatingActionButtonStyle(
backgroundColor: Colors.blue,
collapsedHeight: 56.0,
expandedWidth: 72.0,
animationDuration: Duration(milliseconds: 300),
animationCurve: Curves.easeInOut,
),
);