@override Future<void> close([bool immediate = false]) { if (!immediate) { return widget.onClose?.call() ?? Future.value(); } else { widget.onImmediateClose?.call(); } return Future.value(); }