setNetworkStream method
Set the network stream to listen for connectivity changes.
Implementation
void setNetworkStream(Stream<bool> stream) {
_networkSubscription?.cancel();
_networkSubscription = stream.listen((isOnline) {
if (isOnline) {
process();
}
});
}