dismissWithAnimation method

Future<void> dismissWithAnimation(
  1. ComBannerClosedReason reason
)

Implementation

Future<void> dismissWithAnimation(ComBannerClosedReason reason) async {
  if (reason == ComBannerClosedReason.swipe && mounted) {
    setState(() {
      _isDragging = false;
      _dragOffsetY = -_surfaceHeight * 1.15;
    });
  }
  try {
    await _controller.reverse();
  } catch (_) {
    // The manager still removes the overlay if animation is interrupted.
  }
}