A material design "raised button".
A raised button consists of a rectangular piece of material that hovers over the interface.
Use raised buttons to add dimension to otherwise mostly flat layouts, e.g. in long busy lists of content, or in wide spaces. Avoid using raised buttons on already-raised content such as dialogs or cards.
If the onPressed callback is not specified or null, then the button will be disabled and by default will appear like a flat button in the disabledColor. If you are trying to change the button's color and it is not having any effect, check that you are passing a non-null onPressed handler.
Requires one of its ancestors to be a Material widget.
See also:
- Inheritance
- Object
- Widget
- StatelessWidget
- RaisedButton
Constructors
- RaisedButton({Key key, @required VoidCallback onPressed, Color color, Color disabledColor, int elevation: 2, int highlightElevation: 8, int disabledElevation: 0, Brightness colorBrightness, Widget child })
-
Creates a raised 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. Defaults to null, meaning that the color is automatically derived from the Theme.
read-only - colorBrightness → Brightness
-
The theme brightness to use for this button.
read-only - disabledColor → Color
-
The color of the button when the button is disabled. Buttons are disabled by default. To enable a button, set its onPressed property to a non-null value.
read-only - disabledElevation → int
-
The z-coordinate at which to place this button when disabled.
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 - highlightElevation → int
-
The z-coordinate at which to place this button when highlighted.
read-only - onPressed → VoidCallback
-
The callback that is called when the button is tapped or otherwise activated.
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.
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited -
debugFillDescription(
List<String> description) → void -
Add additional information to the given description for use by toString.
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