Skip to main content

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

  1. isCollapsed (bool)
    Determines if the button is in a collapsed state.

  2. text (String?)
    Optional text displayed inside the button.

  3. 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.

PropertyTypeDescriptionRequiredDefault
backgroundColorColor?Background color of the buttonNoInherited theme
collapsedHeightdouble?Height when the button is collapsedNoNone
expandedWidthdouble?Width when the button is expandedNoNone

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,
),
);