ConnectivityChecker typedef
Callback function type for checking network connectivity.
Should return true if the device has network connectivity,
false otherwise.
This is used by the retry mechanism to avoid unnecessary attempts when the device is offline.
Example using connectivity_plus package:
import 'package:connectivity_plus/connectivity_plus.dart';
Prefs.setConnectivityChecker(() async {
final result = await Connectivity().checkConnectivity();
return result != ConnectivityResult.none;
});
Implementation
typedef ConnectivityChecker = Future<bool> Function();