dispose method

  1. @override
void dispose()
inherited

Disposes the resource.

Implementation

@override
void dispose() {
  final value = _value;
  if (value != null) {
    try {
      onDispose(value);
    } catch (error) {
      if (error is DisposeError) {
        rethrow;
      } else {
        throw DisposeError([error]);
      }
    } finally {
      _value = null;
    }
  }
}