restart method
void
restart()
Implementation
void restart() {
_timer?.cancel();
_last = null;
_timer = Timer.periodic(Duration(seconds: refresh), (t) async {
final connected = await checkConnectivity();
if (connected && !(_last ?? false)) {
_stream.add(true);
_last = true;
} else if (_last ?? true) {
_stream.add(false);
_last = false;
}
});
started = true;
}