RawMaterialButton class

Creates a button based on Semantics, Material, and InkWell widgets.

This class does not use the current Theme or ButtonTheme to compute default values for unspecified parameters. It's intended to be used for custom Material buttons that optionally incorporate defaults from the themes or from app-specific sources.

RaisedButton and FlatButton configure a RawMaterialButton based on the current Theme and ButtonTheme.

Inheritance

Constructors

RawMaterialButton({Key key, @required VoidCallback onPressed, ValueChanged<bool> onHighlightChanged, TextStyle textStyle, Color fillColor, Color focusColor, Color hoverColor, Color highlightColor, Color splashColor, double elevation: 2.0, double focusElevation: 4.0, double hoverElevation: 4.0, double highlightElevation: 8.0, double disabledElevation: 0.0, EdgeInsetsGeometry padding: EdgeInsets.zero, BoxConstraints constraints: const BoxConstraints(minWidth: 88.0, minHeight: 36.0), ShapeBorder shape: const RoundedRectangleBorder(), Duration animationDuration: kThemeChangeDuration, Clip clipBehavior: Clip.none, FocusNode focusNode, bool autofocus: false, MaterialTapTargetSize materialTapTargetSize, Widget child })
Create a button based on Semantics, Material, and InkWell widgets. [...]
const

Properties

animationDuration Duration
Defines the duration of animated changes for shape and elevation. [...]
final
autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused. [...]
final
child Widget
Typically the button's label.
final
clipBehavior Clip
The content will be clipped (or not) according to this option. [...]
final
constraints BoxConstraints
Defines the button's size. [...]
final
disabledElevation double
The elevation for the button's Material when the button is not enabled. [...]
final
elevation double
The elevation for the button's Material when the button is enabled but not pressed. [...]
final
enabled bool
Whether the button is enabled or disabled. [...]
read-only
fillColor Color
The color of the button's Material.
final
focusColor Color
The color for the button's Material when it has the input focus.
final
focusElevation double
The elevation for the button's Material when the button is enabled and has the input focus. [...]
final
focusNode FocusNode
An optional focus node to use as the focus node for this widget. [...]
final
highlightColor Color
The highlight color for the button's InkWell.
final
highlightElevation double
The elevation for the button's Material when the button is enabled and pressed. [...]
final
hoverColor Color
The color for the button's Material when a pointer is hovering over it.
final
hoverElevation double
The elevation for the button's Material when the button is enabled and a pointer is hovering over it. [...]
final
materialTapTargetSize MaterialTapTargetSize
Configures the minimum size of the tap target. [...]
final
onHighlightChanged ValueChanged<bool>
Called by the underlying InkWell widget's InkWell.onHighlightChanged callback. [...]
final
onPressed VoidCallback
Called when the button is tapped or otherwise activated. [...]
final
padding EdgeInsetsGeometry
The internal padding for the button's child.
final
shape ShapeBorder
The shape of the button's Material. [...]
final
splashColor Color
The splash color for the button's InkWell.
final
textStyle TextStyle
Defines the default text style, with Material.textStyle, for the button's child. [...]
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

Methods

createState() → _RawMaterialButtonState
Creates the mutable state for this widget at a given location in the tree. [...]
override
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
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.debug }) String
Returns a string representation of this object.
inherited
toStringDeep({String prefixLineOne: '', String prefixOtherLines, DiagnosticLevel minLevel: DiagnosticLevel.debug }) 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

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited