shouldClose method

FutureOr<bool> shouldClose()

Implementation

FutureOr<bool> shouldClose() async {
  if (_isCheckingShouldClose) return false;
  if (widget.shouldClose == null) return false;
  _isCheckingShouldClose = true;
  final result = await widget.shouldClose?.call();
  _isCheckingShouldClose = false;
  return result ?? false;
}