debug method

dynamic debug()

Prints a text representation of the scope to the console.

Can be useful for debugging if you're not sure that your scope was built/combined correctly.

Implementation

debug() {
  Scope? scope = this;
  while (scope != null) {
    print("SCOPE\n=============================");
    print("Bindings:");
    scope._providers.forEach((key, value) {
      print("${value is FactoryProvider ? 'factory' : 'scoped'} $key");
    });
    print("Multibindings:");
    scope._multibindingProviders.forEach((key, value) {
      print("${value is FactoryProvider ? 'factory' : 'scoped'} $key");
    });
    if (_parentScope != null) print("");
    scope = scope._parentScope;
  }
}