Resource class Null safety

An object with a limited lifespan.

A resource must only be used while isClosed is not true. Failure to do so will result in a StateError being thrown.

While ClosableResources can be explicitly closed, resources which only implement Resource typically depend on another resource and are automatically closed when the that resource is closed.

Implementers

Constructors

Resource()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
isClosed bool
Whether this resource has been closed.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited