dispose method

  1. @override
void dispose()
override

Disposes the resource.

Implementation

@override
void dispose() {
  if (isDisposed) return;
  final disposables = [..._disposables];
  super.dispose();
  _disposables.clear();
  final errors = <Object>[];
  for (final disposable in disposables) {
    try {
      disposable.dispose();
    } catch (error) {
      errors.add(error);
    }
  }
  DisposeError.checkList(errors);
}