A material design icon button.

An icon button is a picture printed on a Material widget that reacts to touches by filling with color.

Icon buttons are commonly used in the actions field, but they can be used in many other places as well.

If the onPressed callback is not specified or null, then the button will be disabled, will not react to touch.

Requires one of its ancestors to be a Material widget.

See also:

Inheritance

Constructors

IconButton({Key key, double size: 24.0, EdgeInsets padding: const EdgeInsets.all(8.0), FractionalOffset alignment: FractionalOffset.center, @required Widget icon, Color color, Color disabledColor, @required VoidCallback onPressed, String tooltip })

Creates an icon button.

const

Properties

alignment FractionalOffset

Defines how the icon is positioned within the IconButton.

read-only
color Color

The color to use for the icon inside the button, if the icon is enabled. Defaults to leaving this up to the icon widget.

read-only
disabledColor Color

The color to use for the icon inside the button, if the icon is disabled. Defaults to the ThemeData.disabledColor of the current Theme.

read-only
icon Widget

The icon to display inside the button.

read-only
onPressed VoidCallback

The callback that is called when the button is tapped or otherwise activated.

read-only
padding EdgeInsets

The padding around the button's icon. The entire padded icon will react to input gestures.

read-only
size double

The size of the icon inside the button.

read-only
tooltip String

Text that describes the action that will occur when the button is pressed.

read-only
hashCode int

Get a hash code for this object.

read-only, inherited
key Key

Controls how one widget replaces another widget in the tree.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

build(BuildContext context) Widget

Describes the part of the user interface represented by this widget.

debugFillDescription(List<String> description) → void

Add additional information to the given description for use by toString.

createElement() StatelessElement

Creates a StatelessElement to manage this widget's location in the tree.

inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited
toStringShort() String

A short, textual description of this widget.

inherited