FloatingActionButton class
A material design floating action button.
A floating action button is a circular icon button that hovers over content to promote a primary action in the application. Floating action buttons are most commonly used in the Scaffold.floatingActionButton field.
Use at most a single floating action button per screen. Floating action buttons should be used for positive actions such as "create", "share", or "navigate".
If the onPressed callback is null, then the button will be disabled and will not react to touch.
See also:
- Inheritance
- Object
- Diagnosticable
- DiagnosticableTree
- Widget
- StatefulWidget
- FloatingActionButton
Constructors
- FloatingActionButton({Key key, Widget child, String tooltip, Color foregroundColor, Color backgroundColor, Object heroTag: const _DefaultHeroTag(), double elevation: 6.0, double highlightElevation: 12.0, @required VoidCallback onPressed, bool mini: false, ShapeBorder shape: const CircleBorder(), Clip clipBehavior: Clip.none, MaterialTapTargetSize materialTapTargetSize, bool isExtended: false })
-
Creates a circular floating action button. [...]
const
- FloatingActionButton.extended({Key key, String tooltip, Color foregroundColor, Color backgroundColor, Object heroTag: const _DefaultHeroTag(), double elevation: 6.0, double highlightElevation: 12.0, @required VoidCallback onPressed, ShapeBorder shape: const StadiumBorder(), bool isExtended: true, MaterialTapTargetSize materialTapTargetSize, Clip clipBehavior: Clip.none, @required Widget icon, @required Widget label })
-
Creates a wider StadiumBorder shaped floating action button with both
an
icon
and alabel
. [...]
Properties
- backgroundColor → Color
-
The color to use when filling the button. [...]
final
- child → Widget
-
The widget below this widget in the tree. [...]
final
- clipBehavior → Clip
-
The content will be clipped (or not) according to this option. [...]
final
- elevation → double
-
The z-coordinate at which to place this button. This controls the size of
the shadow below the floating action button. [...]
final
- foregroundColor → Color
-
The default icon and text color. [...]
final
- heroTag → Object
-
The tag to apply to the button's Hero widget. [...]
final
- highlightElevation → double
-
The z-coordinate at which to place this button when the user is touching
the button. This controls the size of the shadow below the floating action
button. [...]
final
- isExtended → bool
-
True if this is an "extended" floating action button. [...]
final
- materialTapTargetSize → MaterialTapTargetSize
-
Configures the minimum size of the tap target. [...]
final
- mini → bool
-
Controls the size of this button. [...]
final
- onPressed → VoidCallback
-
The callback that is called when the button is tapped or otherwise activated. [...]
final
- shape → ShapeBorder
-
The shape of the button's Material. [...]
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
Methods
-
createState(
) → _FloatingActionButtonState -
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 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