setDependency method
Updates the state by setting or updating dependency.
Implementation
void setDependency(Dependency dependency) {
final groupEntity = switch (dependency.metadata) {
Some(value: final m) => m.groupEntity,
None() => const DefaultEntity(),
};
final typeEntity = dependency.typeEntity;
final currentDep = _state[groupEntity]?[typeEntity];
if (currentDep != dependency) {
(_state[groupEntity] ??= {})[typeEntity] = dependency;
(_typeIndex[typeEntity] ??= <Entity>{}).add(groupEntity);
_fireOnChange();
}
}