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 null, then the button will be disabled and will not react to touch.

Requires one of its ancestors to be a Material widget.

Will be automatically sized up to the recommended 48 logical pixels if smaller.

See also:

Inheritance

Constructors

IconButton({Key key, double iconSize: 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.

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

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

final
icon Widget

The icon to display inside the button.

final
iconSize double

The size of the icon inside the button.

final
onPressed VoidCallback

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

final
padding EdgeInsets

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

final
tooltip String

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

final
hashCode int

The hash code for this object.

read-only, inherited
key Key

Controls how one widget replaces another widget in the tree.

final, 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