reviseComponent method

AFComponentStates reviseComponent(
  1. Type areaType,
  2. List<Object> models
)

Implementation

AFComponentStates reviseComponent(Type areaType, List<Object> models) {
  final revisedStates = Map<String, AFComponentState>.of(states);
  final key = _keyForComponent(areaType);
  if(key == "AFFlexibleState") {
    throw AFException("Attempting to set models on 'AFFlexibleState', this is most likely because you forgot to explicitly specify your AFFlexibleState type as a type parameter somewhere.");
  }
  final initialState = states[key];
  assert(initialState != null);
  if(initialState != null) {
    final revisedState = initialState.reviseModels(models);
    revisedStates[key] = revisedState;
  }

  final log = AFibD.logStateAF;
  if(log != null) {
    log.d("In area $areaType revised");
    for(final model in models ) {
      log.d("  ${model.runtimeType}: ${model.toString()}");
    }
  }

  return AFComponentStates(states: revisedStates);
}