SwipeButtonWidget constructor
const
SwipeButtonWidget({
- Key? key,
- Widget childBeforeSwipe = const Icon(Icons.arrow_forward_ios),
- Widget childAfterSwiped = const Icon(Icons.arrow_back_ios),
- double? height,
- double? width,
- EdgeInsetsGeometry margin = const EdgeInsets.all(0),
- EdgeInsetsGeometry padding = const EdgeInsets.all(0),
- Color? colorBeforeSwipe = Colors.green,
- Color? colorAfterSwiped = Colors.red,
- List<
BoxShadow> boxShadow = const [BoxShadow(color: Colors.black54, blurRadius: 6, offset: Offset(0, 4))], - BorderRadiusGeometry? borderRadius,
- Duration duration = const Duration(milliseconds: 50),
- BoxConstraints? constraints,
- List<
Widget> rightChildren = const [], - List<
Widget> leftChildren = const [], - required void onHorizontalDragUpdate(
- DragUpdateDetails details
- required Future<
bool> onHorizontalDragRight(- DragEndDetails details
- required Future<
bool> onHorizontalDragleft(- DragEndDetails details
- 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);