dispose method

  1. @mustCallSuper
  2. @override
void dispose()

implement this method,should be end with super.dispose()

Implementation

@mustCallSuper
@override
void dispose() {
  if (_timer != null && _timer!.isActive) {
    _timer?.cancel();
  }
  removeObservers();
  super.dispose();
}