initScope method

GetIt initScope(
  1. String name, {
  2. required void init(
    1. GetItHelper gh
    ),
  3. ScopeDisposeFunc? dispose,
})

a helper method to push a new scope and init it's dependencies inside of GetIt

Implementation

GetIt initScope(String name,
    {required void Function(GetItHelper gh) init,
    ScopeDisposeFunc? dispose}) {
  getIt.pushNewScope(
    scopeName: name,
    init: (_) => init(this),
    dispose: dispose,
  );
  return getIt;
}