backLegacy<T> method
void
backLegacy<T>({})
Implementation
void backLegacy<T>({
T? result,
bool closeOverlays = false,
bool canPop = true,
int times = 1,
String? id,
}) {
if (closeOverlays) {
closeAllOverlays();
}
if (times < 1) {
times = 1;
}
if (times > 1) {
var count = 0;
return searchDelegate(id).navigatorKey.currentState?.popUntil((route) {
return count++ == times;
});
} else {
if (canPop) {
if (searchDelegate(id).navigatorKey.currentState?.canPop() == true) {
return searchDelegate(id).navigatorKey.currentState?.pop<T>(result);
}
} else {
return searchDelegate(id).navigatorKey.currentState?.pop<T>(result);
}
}
}