updateVariable method
Implementation
void updateVariable(ID stateID, Variable id) {
final states = {...state.states};
assert(states.containsKey(stateID), 'State not found');
final selectedState = states[stateID]!;
final variables = {...selectedState.fields};
assert(variables.containsKey(id.id), 'Variable not found');
variables[id.id] = id;
states[stateID] = selectedState.copyWith(fields: variables);
emit(
state.copyWith(
states: states,
),
);
}