SwipeButton constructor

const SwipeButton({
  1. Key? key,
  2. required Widget child,
  3. Widget? thumb,
  4. Color? activeThumbColor,
  5. Color? inactiveThumbColor,
  6. EdgeInsets thumbPadding = EdgeInsets.zero,
  7. Color? activeTrackColor,
  8. Color? inactiveTrackColor,
  9. EdgeInsets trackPadding = EdgeInsets.zero,
  10. SwipeButtonShape shape = SwipeButtonShape.rectangle,
  11. double width = double.infinity,
  12. double height = 50,
  13. bool enabled = true,
  14. double elevationThumb = 0,
  15. double elevationTrack = 0,
  16. VoidCallback? onSwipeStart,
  17. VoidCallback? onSwipe,
  18. VoidCallback? onSwipeEnd,
  19. Duration duration = const Duration(milliseconds: 250),
  20. bool bidirectional = false,
  21. Widget? icon,
  22. Gradient? activeTrackGradient,
  23. Widget thumbBuilder(
    1. bool isSwiped
    )?,
})

Implementation

const SwipeButton({
  Key? key,
  required this.child,
  this.thumb,
  this.activeThumbColor,
  this.inactiveThumbColor,
  this.thumbPadding = EdgeInsets.zero,
  this.activeTrackColor,
  this.inactiveTrackColor,
  this.trackPadding = EdgeInsets.zero,
  this.shape = SwipeButtonShape.rectangle,
  this.width = double.infinity,
  this.height = 50,
  this.enabled = true,
  this.elevationThumb = 0,
  this.elevationTrack = 0,
  this.onSwipeStart,
  this.onSwipe,
  this.onSwipeEnd,
  this.duration = const Duration(milliseconds: 250),
  this.bidirectional = false,
  this.icon,
  this.activeTrackGradient,
  this.thumbBuilder,
})  : assert(elevationThumb >= 0.0),
      assert(elevationTrack >= 0.0),
      super(key: key);