until method

void until(
  1. bool predicate(
    1. GetPage
    ), {
  2. String? id,
})

Navigation.popUntil() shortcut.

Calls pop several times in the stack until predicate returns true

id is for when you are using nested navigation, as explained in documentation

predicate can be used like this: Get.until((route) => Get.currentRoute == '/home')so when you get to home page,

or also like this: Get.until((route) => !Get.isDialogOpen()), to make sure the dialog is closed

Implementation

void until(bool Function(GetPage<dynamic>) predicate, {String? id}) {
  // if (key.currentState.mounted) // add this if appear problems on future with route navigate
  // when widget don't mounted
  return searchDelegate(id).backUntil(predicate);
}