singleton property

Resolvable<T> get singleton

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

Implementation

@pragma('vm:prefer-inline')
Resolvable<T> get singleton {
  return (currentInstance.isNone()
          ? currentInstance = Some(_constructor())
          : currentInstance)
      .unwrap();
}