NeoPopButton class

A neopop design button.

Use this to implement neopop design button in your layouts. This can be used on normal surfaces like cards, dialogs, etc as well as on NeoPopCard.

A NeoPopButton is a custom painted container wrapped with a ClipPath. The painter and clipper depends on the position of the NeoPopButton in the layout. The NeoPopButton can be positioned in one of the 12 positions defined in the enum Position. You can imagine nine of the twelve positions as being the nine boxes of a tic-tac-toe game. The other three positions cover the cases when the NeoPopButton covers or appears to cover full width of the layout.

If onTapUp is null or enabled is set to false, the button will be disabled.

See code in example for the sample.

See also:

Inheritance

Constructors

NeoPopButton({required Widget child, required Color color, VoidCallback? onTapUp, VoidCallback? onTapDown, VoidCallback? onLongPress, Color disabledColor = kDisabledButtonColor, Color parentColor = Colors.transparent, Color grandparentColor = Colors.transparent, Position buttonPosition = Position.fullBottom, Duration animationDuration = kbuttonDuration, Duration? forwardDuration, Duration? reverseDuration, Border? border, double depth = kButtonDepth, bool enabled = true, Color? shadowColor, Color? rightShadowColor, Color? leftShadowColor, Color? topShadowColor, Color? bottomShadowColor, Key? key})
Creates a neopop button.
const

Properties

animationDuration Duration
The combined duration of the forward and reverse animation in milliseconds when the button is pressed. forwardDuration = animationDuration ~/ 2 reverseDuration = animationDuration ~/ 2
final
border Border?
The border to be painted around the button.
final
bottomShadowColor Color?
The color of the bottom shadow.
final
buttonPosition Position
The position of the button in the layout.
final
child Widget
The widget below this widget in the tree.
final
color Color
The color of the button.
final
depth double
The depth of the button.
final
disabledColor Color
The color of the button when it is disabled.
final
enabled bool
If set to false, the button will be disabled.
final
forwardDuration Duration?
Forward duration for button pressed animation
final
grandparentColor Color
The color of the grandparent widget.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leftShadowColor Color?
The color of the left shadow.
final
onLongPress VoidCallback?
Called when a long press gesture with a neopop button has been recognized.
final
onTapDown VoidCallback?
A pointer that might cause a tap with a neopop button has contacted the screen at a particular location.
final
onTapUp VoidCallback?
A pointer that will trigger a tap with a neopop button has stopped contacting the screen at a particular location.
final
parentColor Color
The color of the parent widget.
final
reverseDuration Duration?
Reverse duration for button pressed animation
final
rightShadowColor Color?
The color of the right shadow.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor Color?
The base color of the shadow. The shadow colors will be derived from this.
final
topShadowColor Color?
The color of the top shadow.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<NeoPopButton>
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