retryWhenOnline method
void
retryWhenOnline(})
Implementation
void retryWhenOnline(
Future<void> Function() task, {
int maxRetries = 3,
Duration delay = const Duration(seconds: 2),
}) async {
bool hasConnection = await ZoConnectivityWatcher().isInternetAvailable;
if (hasConnection) {
_tryRun(task, maxRetries, delay);
} else {
_tasks.add(_RetryTask(task, maxRetries, delay));
_listen();
}
}