putLazy<T> static method

void putLazy<T>(
  1. T factory(), {
  2. String? tag,
  3. bool? isPermanent,
})

Register a lazy factory in root scope

Implementation

static void putLazy<T>(T Function() factory,
    {String? tag, bool? isPermanent}) {
  // Keep lazy behavior simple and explicit
  final permanent = isPermanent ?? false;
  rootScope.putLazy<T>(factory, tag: tag, isPermanent: permanent);
}