Button class

A pressable button widget that responds to keyboard input.

Use onPressed for click handling. Supports style and focusStyle customization, and enabled for disabled state.

Inheritance

Constructors

Button({Key? key, required String text, VoidCallback? onPressed, bool enabled = true, ButtonStyle? style, FocusNode? focusNode})
const

Properties

enabled bool
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
finalinherited
onPressed VoidCallback?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style ButtonStyle?
final
text String
final

Methods

createElement() StatefulElement
inherited
createState() State<Button>
override
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