SwipingButton constructor

const SwipingButton({
  1. Key? key,
  2. required double thumbWidth,
  3. required Size size,
  4. VoidCallback? onSwipeComplete,
  5. bool validateOnScroll()?,
  6. SwipingButtonController? swipingButtonController,
  7. String text = "",
  8. TextStyle textStyle = const TextStyle(color: Colors.grey),
  9. bool turnOfAnimation = false,
  10. Duration textAnimationDuration = const Duration(milliseconds: 1000),
  11. double thumbBorderRadius = 50,
  12. Color thumbColor = Colors.white,
  13. Color swipedBgColor = Colors.green,
  14. double borderRadius = 50,
  15. Widget thumbChild = const Center(child: Icon(Icons.fast_forward)),
  16. List<BoxShadow> boxShadow = const [BoxShadow(color: Colors.grey, offset: Offset(-3, -3), blurRadius: 8, spreadRadius: 8), BoxShadow(color: Colors.grey, offset: Offset(4, 4), blurRadius: 8, spreadRadius: 8)],
  17. List<BoxShadow> thumbBoxShadow = const [BoxShadow(color: Colors.black, blurRadius: 1, spreadRadius: 0), BoxShadow(color: Colors.white, blurRadius: 10, spreadRadius: 5)],
  18. List<Color> textGradientColor = const [Colors.grey, Colors.white],
  19. Color bgColor = Colors.white,
  20. Border thumbBorder = const Border.fromBorderSide(BorderSide(color: Colors.black12)),
})

Implementation

const SwipingButton(
    {Key? key,
    required this.thumbWidth,
    required this.size,
    this.onSwipeComplete,
    this.validateOnScroll,
    this.swipingButtonController,
    this.text = "",
    this.textStyle = const TextStyle(color: Colors.grey),
    this.turnOfAnimation = false,
    this.textAnimationDuration = const Duration(milliseconds: 1000),
    this.thumbBorderRadius = 50,
    this.thumbColor = Colors.white,
    this.swipedBgColor = Colors.green,
    this.borderRadius = 50,
    this.thumbChild = const Center(
      child: Icon(Icons.fast_forward),
    ),

    this.boxShadow = const [
      BoxShadow(
          color: Colors.grey,
          offset: Offset(-3, -3),
          blurRadius: 8,
          spreadRadius: 8),
      BoxShadow(
          color: Colors.grey,
          offset: Offset(4, 4),
          blurRadius: 8,
          spreadRadius: 8)
    ],
    this.thumbBoxShadow = const [
      BoxShadow(color: Colors.black, blurRadius: 1, spreadRadius: 0),
      BoxShadow(color: Colors.white, blurRadius: 10, spreadRadius: 5),
    ],
    this.textGradientColor = const [
      Colors.grey,
      Colors.white,
    ],
    this.bgColor =  Colors.white,
    this.thumbBorder = const Border.fromBorderSide(
      BorderSide(color: Colors.black12),
    )})
    : super(key: key);