stop method

Future stop()

Implementation

Future stop() {
  if (_timer == null) {
    throw Exception('Polling not started.');
  }

  _timer!.cancel();
  final future = _controller!.close();

  _timer = null;
  _controller = null;

  return future;
}