InternetConnectionChecker constructor
InternetConnectionChecker({
- void onInternetConnectionRestored()?,
- void onInternetConnectionLost()?,
Implementation
InternetConnectionChecker({
void Function()? onInternetConnectionRestored,
void Function()? onInternetConnectionLost,
}) {
this._stream =
Connectivity().onConnectivityChanged.listen((_) => this._debouncer());
() async {
await this.hasInternet();
this.pHasInternet.addListener(() async {
(this.pHasInternet.value
? onInternetConnectionRestored
: onInternetConnectionLost)
?.call();
});
}();
}