shouldClose method
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;
}