ProKitButton class

A highly reusable, accessible and theme-compliant button for ProKit. Supports all common styles: raised, flat, outlined, icon, gradient.

Inheritance
Available extensions

Constructors

ProKitButton.new({Key? key, String? text, int? textLines, TextAlign? textAlign, VoidCallback? onPressed, bool showIcon = false, String? iconAsset, Widget? customIconWidget, Color? iconColor, Color? buttonColor, EdgeInsetsGeometry? padding, TextStyle? textStyle, BorderRadiusGeometry? borderRadius, double? elevation, ShapeBorder? shape, double? width, double? height, AlignmentGeometry? alignment, ProKitButtonStyle buttonStyle = ProKitButtonStyle.raised, Gradient? gradient, bool isDisabled = false, bool isLoading = false, String? tooltip, String? semanticLabel})
const

Properties

alignment AlignmentGeometry?
Alignment of content inside button
final
borderRadius BorderRadiusGeometry?
Border radius
final
buttonColor Color?
Background color of the button
final
buttonStyle ProKitButtonStyle
Style of the button (required)
final
customIconWidget Widget?
Custom icon widget override (optional)
final
elevation double?
Elevation for raised buttons
final
gradient Gradient?
Gradient for gradient style
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Fixed height of button
final
iconAsset String?
SVG asset name for the icon (optional if customIconWidget is used)
final
iconColor Color?
Icon color
final
isDisabled bool
If true, disables the button and applies disabled styling
final
isLoading bool
If true, shows a loading spinner instead of content
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onPressed VoidCallback?
OnPressed callback
final
padding EdgeInsetsGeometry?
Padding inside the button
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
For accessibility: screen reader label
final
shape ShapeBorder?
Custom shape (not used for now)
final
showIcon bool
Whether to show an icon before text
final
text String?
Main button text
final
textAlign TextAlign?
Text alignment inside the button
final
textLines int?
Number of lines for text wrapping
final
textStyle TextStyle?
Text style
final
tooltip String?
Tooltip text
final
width double?
Fixed width of button
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
center() Widget

Available on Widget, provided by the WidgetPadding extension

Wrap the Widget with Center
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
isVisible(bool isVisible) Widget

Available on Widget, provided by the VisibilityExtension extension

Shows or hides the widget based on isVisible.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTap(VoidCallback onTap) Widget

Available on Widget, provided by the WidgetTap extension

Wraps the widget with an InkWell to provide onTap functionality.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
wrapWithPadding(EdgeInsets padding) Widget

Available on Widget, provided by the WidgetPadding extension

Wraps the widget with given EdgeInsets padding.

Operators

operator ==(Object other) bool
The equality operator.
inherited