addUninitialized<InputState> method

  1. @visibleForTesting
void addUninitialized<InputState>({
  1. required String type,
  2. InputState? params,
  3. int? index,
  4. String? scope,
})

Adds instance in collection

Does not call MvvmInstance.initialize for this isntance

type - string type of this instance index - index for this instance scope - string scope to get instance from params - params for this instance

Implementation

@visibleForTesting
void addUninitialized<InputState>({
  required String type,
  InputState? params,
  int? index,
  String? scope,
}) {
  final id = type;
  final scopeId = scope ?? BaseScopes.global;

  final builder = builders[id];

  final newInstance = builder!();

  container.addObjectInScope(
    object: newInstance,
    type: type,
    scopeId: scopeId,
  );
}