resetAll static method

void resetAll({
  1. bool keepScopes = true,
})

Resets all pots of all scopes.

This discards all the objects bound to any scopes, and triggers the disposer of each pot.

If keepScopes is true or not specified, calling this method does not affect the scopes themselves; the index number of the current scope stays the same. Otherwise, the index is reset to 0.

See reset for details on a reset of an object.

Implementation

static void resetAll({bool keepScopes = true}) {
  final count = StaticPot.currentScope;
  for (var i = count; i >= 0; i--) {
    StaticPot.scopes.clearScope(i, keepScope: keepScopes);
  }
}