retryUntil function

bool retryUntil(
  1. bool predicate(), {
  2. int maxAttempts = 10,
})

Implementation

bool retryUntil(bool Function() predicate, {int maxAttempts = 10}) {
  for (int i = 0; i < maxAttempts; i++) {
    if (predicate()) return true;
  }
  return false;
}