pushNewScope method

void pushNewScope({
  1. String? scopeName,
  2. ScopeDisposeFunc? dispose,
})

Creates a new registration scope. If you register types after creating a new scope they will hide any previous registration of the same type. Scopes allow you to manage different live times of your Objects. scopeName if you name a scope you can pop all scopes above the named one by using the name. dispose function that will be called when you pop this scope. The scope is still valied while it is executed

Implementation

void pushNewScope({String? scopeName, ScopeDisposeFunc? dispose}) =>
    locator.pushNewScope(
      scopeName: scopeName,
      dispose: dispose,
    );