lazy<T> static method

T lazy<T>(
  1. SingletonFactory<T> factory, {
  2. String? name = null,
})

Register or fetch a lazy singleton for T

If singleton wrapper haven't been registered, a new wrapper will be created Else previously registered singleton wrapper will be returned

Implementation

static T lazy<T>(SingletonFactory<T> factory, {String? name = null}) =>
    Singleton.registerLazy(factory, name: name).instance;