getById method

C getById(
  1. I id
)

returns the cubit identified by this id. Throws an UnsupportedError if no cubit found. You should register new objects by using add before trying to get them

Implementation

C getById(I id) {
  final cubit = _cubits[id];
  if (cubit == null) {
    throw UnsupportedError("$C not found for $T id $id");
  }
  return cubit;
}