case DismissType.onSwipe:
var childWidget = widget.child;
for (final direction in widget.dismissDirections) {
childWidget = TapBounceContainer(
onTap: () {
widget.onTap?.call();
if (!widget.persistent && mounted) {
_animationController.reverse();
}
},
child: Dismissible(
direction: direction,
key: UniqueKey(),
dismissThresholds: const {DismissDirection.up: 0.2},
confirmDismiss: (direction) async {
if (!widget.persistent && mounted) {
if (direction == DismissDirection.down) {
await _animationController.reverse();
} else {
_animationController.reset();
}
}
return false;
},
child: childWidget,
),
);
}
return childWidget;
A bug was found in the
_buildDismissibleChild()method of top_snack_bar.dart. Here, forDismissType.onSwipe, theonTapalso reverses the animation: