NeoPopButton constructor

const NeoPopButton({
  1. required Widget child,
  2. required Color color,
  3. VoidCallback? onTapUp,
  4. VoidCallback? onTapDown,
  5. VoidCallback? onLongPress,
  6. Color disabledColor = kDisabledButtonColor,
  7. Color parentColor = Colors.transparent,
  8. Color grandparentColor = Colors.transparent,
  9. Position buttonPosition = Position.fullBottom,
  10. Duration animationDuration = kbuttonDuration,
  11. Duration? forwardDuration,
  12. Duration? reverseDuration,
  13. Border? border,
  14. double depth = kButtonDepth,
  15. bool enabled = true,
  16. Color? shadowColor,
  17. Color? rightShadowColor,
  18. Color? leftShadowColor,
  19. Color? topShadowColor,
  20. Color? bottomShadowColor,
  21. 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);