isCovered property

bool get isCovered

Whether a modal sheet is currently inside its reverse dismiss animation window. Returns false once the animation finishes (dismissed) or once _maxCoverDuration has elapsed since the reverse animation started, whichever comes first.

Implementation

bool get isCovered {
  if (!_isClosing) return false;
  final startedAt = _closingStartedAt;
  if (startedAt == null) return false;
  if (DateTime.now().difference(startedAt) > _maxCoverDuration) {
    // Safety fallback: dismissed callback never arrived (e.g. route was
    // disposed externally). Auto-clear so we cannot get stuck.
    _isClosing = false;
    _closingStartedAt = null;
    return false;
  }
  return true;
}