A material design button.
Rather than using this class directly, consider using FlatButton or RaisedButton.
MaterialButtons whose onPressed handler is null will be disabled. To have an enabled button, make sure to pass a non-null value for onPressed.
- Inheritance
- Object
- Widget
- StatefulWidget
- MaterialButton
Constructors
- MaterialButton({Key key, Brightness colorBrightness, ButtonTextTheme textTheme, Color textColor, Color color, int elevation, int highlightElevation, double minWidth, double height, EdgeInsets padding, @required VoidCallback onPressed, Widget child })
-
Creates a material button.
Properties
- child → Widget
-
The widget below this widget in the tree.
read-only - color → Color
-
The color of the button, as printed on the Material.
read-only - colorBrightness → Brightness
-
The theme brightness to use for this button.
read-only - elevation → int
-
The z-coordinate at which to place this button.
read-only - enabled → bool
-
Whether the button is enabled or disabled. Buttons are disabled by default. To enable a button, set its
onPressed
property to a non-null value.read-only - height → double
-
The vertical extent of the button.
read-only - highlightElevation → int
-
The z-coordinate at which to place this button when highlighted.
read-only - minWidth → double
-
The smallest horizontal extent that the button will occupy.
read-only - onPressed → VoidCallback
-
The callback that is called when the button is tapped or otherwise activated.
read-only - padding → EdgeInsets
-
The amount of space to surround the child inside the bounds of the button.
read-only - textColor → Color
-
The color to use for this button's text.
read-only - textTheme → ButtonTextTheme
-
The color scheme to use for this button's text.
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
-
createState(
) → _MaterialButtonState -
Creates the mutable state for this widget at a given location in the tree.
-
debugFillDescription(
List<String> description) → void -
Add additional information to the given description for use by
toString
. -
createElement(
) → StatefulElement -
Creates a StatefulElement 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