addExisting method

void addExisting({
  1. String scope = BaseScopes.global,
  2. required MvvmInstance instance,
})

Adds existing instance to collection

scope - string scope value instance - given instance to add

Implementation

void addExisting({
  String scope = BaseScopes.global,
  required MvvmInstance instance,
}) {
  final id = instance.runtimeType.toString();

  container.addObjectInScope(
    object: instance,
    type: id,
    scopeId: scope,
  );
}