swipeToDismiss method
Implementation
Widget swipeToDismiss({
required Key key,
required Future<bool?> Function(DismissDirection) onDismiss,
Color backgroundColor = Colors.red,
Widget? background,
}) => Dismissible(
key: key,
confirmDismiss: onDismiss,
background:
background ??
Container(
color: backgroundColor,
alignment: Alignment.centerRight,
padding: const EdgeInsets.only(right: 16),
child: const Icon(Icons.delete, color: Colors.white),
),
child: this,
);