SwipeButtonWidget constructor

const SwipeButtonWidget({
  1. Key? key,
  2. Widget childBeforeSwipe = const Icon(Icons.arrow_forward_ios),
  3. Widget childAfterSwiped = const Icon(Icons.arrow_back_ios),
  4. double? height,
  5. double? width,
  6. EdgeInsetsGeometry margin = const EdgeInsets.all(0),
  7. EdgeInsetsGeometry padding = const EdgeInsets.all(0),
  8. Color? colorBeforeSwipe = Colors.green,
  9. Color? colorAfterSwiped = Colors.red,
  10. List<BoxShadow> boxShadow = const [BoxShadow(color: Colors.black54, blurRadius: 6, offset: Offset(0, 4))],
  11. BorderRadiusGeometry? borderRadius,
  12. Duration duration = const Duration(milliseconds: 50),
  13. BoxConstraints? constraints,
  14. List<Widget> rightChildren = const [],
  15. List<Widget> leftChildren = const [],
  16. required void onHorizontalDragUpdate(
    1. DragUpdateDetails details
    ),
  17. required Future<bool> onHorizontalDragRight(
    1. DragEndDetails details
    ),
  18. required Future<bool> onHorizontalDragleft(
    1. DragEndDetails details
    ),
  19. double acceptPoitTransition = 0.5,
})

AcceptPointTransition from 0 to 1

rightChildren & leftChildren is Stack

Implementation

const SwipeButtonWidget({
  Key? key,
  this.childBeforeSwipe = const Icon(Icons.arrow_forward_ios),
  this.childAfterSwiped = const Icon(Icons.arrow_back_ios),
  this.height,
  this.width,
  this.margin = const EdgeInsets.all(0),
  this.padding = const EdgeInsets.all(0),
  this.colorBeforeSwipe = Colors.green,
  this.colorAfterSwiped = Colors.red,
  this.boxShadow = const [
    BoxShadow(
      color: Colors.black54,
      blurRadius: 6,
      offset: Offset(0, 4),
    ),
  ],
  this.borderRadius,
  this.duration = const Duration(milliseconds: 50),
  this.constraints,
  this.rightChildren = const [],
  this.leftChildren = const [],
  required this.onHorizontalDragUpdate,
  required this.onHorizontalDragRight,
  required this.onHorizontalDragleft,
  this.acceptPoitTransition = 0.5,
})  : assert(acceptPoitTransition <= 1 && acceptPoitTransition >= 0),
      super(key: key);