singleton property

FutureOr<T> get singleton

Returns the singleton instance currentInstance, or creating it if necessary.

Implementation

FutureOr<T> get singleton => currentInstance ??= _constructor();