NeoPopButton constructor
- 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.
The child
and color
parameters are required. color
is the
color of the button. If the shadow colors are not specified,
they will be derived from the color
parameter.
The animationDuration
parameter specifies the duration of the
animation when the button is pressed. Forward and reversed animation
durations can be specified separately using the forwardDuration
and reversedDuration
parameters. By default, the animation duration
is set to 50.0 milliseconds.
The onTapUp
parameter specifies the callback that is called when
the button is tapped. The onTapDown
parameter specifies the callback
that is called when the pointer that might cause a tap with button
touches the screen. The onLongPress
parameter specifies the callback
that is called when the button is long pressed.
The parentColor
and grandparentColor
are the colors of the parent
and grandparent widgets of the button. These are used to derive the
edge and shadow colors. If the colors are not specified, they will be
derived from the color
parameter. You can also specify the shadowColor
using which the different shadow colors will be derived.
Alternatively, you can specify the color of each shadow separately using
the topShadowColor
, bottomShadowColor
, leftShadowColor
, and
rightShadowColor
parameters.
The depth of the button can be specified using the depth
parameter.
Implementation
const NeoPopButton({
required this.child,
required this.color,
this.onTapUp,
this.onTapDown,
this.onLongPress,
this.disabledColor = kDisabledButtonColor,
this.parentColor = Colors.transparent,
this.grandparentColor = Colors.transparent,
this.buttonPosition = Position.fullBottom,
this.animationDuration = kbuttonDuration,
this.forwardDuration,
this.reverseDuration,
this.border,
this.depth = kButtonDepth,
this.enabled = true,
this.shadowColor,
this.rightShadowColor,
this.leftShadowColor,
this.topShadowColor,
this.bottomShadowColor,
Key? key,
}) : super(key: key);