EmergentButton class
A Emergent Button
When pressed, it will fire a call to its EmergentButtonClickListener click parameter The animation starts from style.depth (or theme.depth is not defined in the style) @see EmergentStyle
And finished to minDistance
, in duration (time)
You can force the pressed state using pressed
- true : forced as pressed
- false : forced as unpressed
- null : can be pressed by user
It takes a padding, default EdgeInsets.symmetric(horizontal: 8, vertical: 4)`
It takes a EmergentStyle @see Emergent
EmergentButton(
onClick: () {
setState(() {
...
});
},
boxShape: EmergentBoxShape.roundRect(BorderRadius.circular(12)),
style: EmergentStyle(
shape: EmergentShape.flat,
),
child: ...
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- EmergentButton
- Annotations
Constructors
- EmergentButton({Key? key, EdgeInsets? padding, EdgeInsets? margin = EdgeInsets.zero, Widget? child, String? tooltip, bool drawSurfaceAboveChild = true, bool? pressed, Duration duration = Emergent.defaultDuration, Curve curve = Emergent.defaultCurve, EmergentButtonClickListener? onPressed, double minDistance = 0, EmergentStyle? style, bool provideHapticFeedback = true})
-
const
Properties
- child → Widget?
-
final
- curve → Curve
-
final
- drawSurfaceAboveChild → bool
-
final
- duration → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEnabled → bool
-
no setter
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → EdgeInsets?
-
final
- minDistance → double
-
final
- onPressed → EmergentButtonClickListener?
-
final
- padding → EdgeInsets?
-
final
- pressed → bool?
-
final
- provideHapticFeedback → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → EmergentStyle?
-
final
- tooltip → String?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → EmergentButtonState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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.info}) → String -
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 ==(
Object other) → bool -
The equality operator.
inherited
Constants
- pressedScale → const double
- unpressedScale → const double