pot library

Classes

Pot<T>
A class that instantiates and caches an object of type T until it is discarded.
PotDescription
A class that describes the details of a Pot.
PotEvent
A class that represents an event related to Pot.
ReplaceablePot<T>
A variant of Pot with the replace method that allows its factory to be replaced.

Enums

PotEventKind
The types of events that can occur in relation to Pot.

Typedefs

PotDisposer<T> = void Function(T)
The signature of a callback that receives an object of type T to be disposed of.
PotListenerRemover = Future<void> Function()
The signature of a function that removes the listener added by listen().
PotObjectFactory<T> = T Function()
The signature of a Singleton factory that creates and returns an object of type T.

Exceptions / Errors

PotNotReadyException
Exception thrown if a pot with no factory is used.
PotReplaceError
Error thrown if replaceForTesting is used when Pot.forTesting is not enabled.