close method
void
close({})
Navigation.popUntil() (with predicate) shortcut .
Close as many routes as defined by times
id
is for when you are using nested navigation,
as explained in documentation
Implementation
void close({
bool closeAll = true,
bool closeSnackbar = true,
bool closeDialog = true,
bool closeBottomSheet = true,
String? id,
T? result,
}) {
void handleClose(
bool closeCondition,
Function closeAllFunction,
Function closeSingleFunction, [
bool? isOpenCondition,
]) {
if (closeCondition) {
if (closeAll) {
closeAllFunction();
} else if (isOpenCondition == true) {
closeSingleFunction();
}
}
}
handleClose(closeSnackbar, closeAllSnackbars, closeCurrentSnackbar);
handleClose(closeDialog, closeAllDialogs, closeOverlay, isDialogOpen);
handleClose(
closeBottomSheet,
closeAllBottomSheets,
closeOverlay,
isBottomSheetOpen,
);
}