getWithParamsAsync<MInstance extends MvvmInstance, InputState> method

Future<MInstance> getWithParamsAsync<MInstance extends MvvmInstance, InputState>({
  1. InputState? params,
  2. int? index,
  3. String scope = BaseScopes.global,
  4. bool withoutConnections = false,
})

Return instance for given type

Also calls MvvmInstance.initialize for this instance

index - index for this instance scope - string scope to get instance from withoutConnections - flag indicating that instance dependencies won`t be connected params - params for this instance

Implementation

Future<MInstance>
    getWithParamsAsync<MInstance extends MvvmInstance, InputState>({
  InputState? params,
  int? index,
  String scope = BaseScopes.global,
  bool withoutConnections = false,
}) {
  final runtimeType = MInstance.toString();

  return getInstanceFromCacheAsync<MInstance, InputState>(
    runtimeType,
    params: params,
    index: index,
    scopeId: scope,
    withoutConnections: withoutConnections,
  );
}