NeumorphicButton class

A Neumorphic Button

When pressed, it will fire a call to its NeumorphicButtonClickListener click parameter The animation starts from style.depth (or theme.depth is not defined in the style) @see NeumorphicStyle

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 NeumorphicStyle @see Neumorphi

 NeumorphicButton(
         onClick: () {
           setState(() {
              ...
           });
         },
         boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(12)),
         style: NeumorphicStyle(
           shape: NeumorphicShape.flat,
         ),
         child: ...
 )
Inheritance
Annotations

Constructors

NeumorphicButton({Key? key, EdgeInsets? padding, EdgeInsets? margin = EdgeInsets.zero, Widget? child, String? tooltip, bool drawSurfaceAboveChild = true, bool? pressed, Duration duration = Neumorphic.DEFAULT_DURATION, Curve curve = Neumorphic.DEFAULT_CURVE, NeumorphicButtonClickListener? onPressed, double minDistance = 0, NeumorphicStyle? style, bool provideHapticFeedback = true})

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 → NeumorphicButtonClickListener?
final
padding → EdgeInsets?
final
pressed → bool?
final
provideHapticFeedback → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → NeumorphicStyle?
final
tooltip → String?
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _NeumorphicButtonState
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, int wrapWidth = 65}) → 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

PRESSED_SCALE → const double
UNPRESSED_SCALE → const double