SwipingButton constructor
const
SwipingButton({
- Key? key,
- required double thumbWidth,
- required Size size,
- VoidCallback? onSwipeComplete,
- bool validateOnScroll()?,
- SwipingButtonController? swipingButtonController,
- String text = "",
- TextStyle textStyle = const TextStyle(color: Colors.grey),
- bool turnOfAnimation = false,
- Duration textAnimationDuration = const Duration(milliseconds: 1000),
- double thumbBorderRadius = 50,
- Color thumbColor = Colors.white,
- Color swipedBgColor = Colors.green,
- double borderRadius = 50,
- Widget thumbChild = const Center(child: Icon(Icons.fast_forward)),
- 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)], - List<
BoxShadow> thumbBoxShadow = const [BoxShadow(color: Colors.black, blurRadius: 1, spreadRadius: 0), BoxShadow(color: Colors.white, blurRadius: 10, spreadRadius: 5)], - List<
Color> textGradientColor = const [Colors.grey, Colors.white], - Color bgColor = Colors.white,
- 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);