InlineButton Documentation
Overview
The InlineButton
widget is a lightweight, text-based button that provides a tappable area without a background. It is ideal for inline actions like links or textual interactions within a Flutter application. It extends CwButton
, making it reusable and consistent with other button components.
Parameters Explanation
Below are the parameters available for InlineButton
:
onButtonTap
(required): The callback function executed when the button is tapped.prefixIcon
: An optional widget displayed before the label (e.g., an icon or image).suffixIcon
: An optional widget displayed after the label.label
: AText
widget that contains the button text.hoverColor
: Defines the color when the button is hovered over.splashColor
: Specifies the color when the button is tapped.splashFactor
: Defines the ink splash effect when tapped.padding
: Controls the internal padding of the button.
Usage Example
InlineButton(
onButtonTap: () => print("Inline Button Clicked"),
label: Text("Inline Button"),
hoverColor: Colors.grey.shade200,
splashColor: Colors.blue.shade100,
prefixIcon: Icon(Icons.link),
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
);
Source Code Repository
Find the full source code on GitHub: GitHub Repository