getOptionalVariableById<T> method
Implementation
VariableInfoEntity getOptionalVariableById<T>(
ID id, {
ID? cubitID,
ID? stateID,
}) {
if (cubitID != null && stateID != null) {
final variableInfo = appCubit.getVariableById(
cubitID: cubitID,
stateID: stateID,
variableID: id,
);
assert(
variableInfo.variable is T, 'Variable with id $id is not of type $T');
return variableInfo;
}
assert(getCurrentStatesVariables[id] != null,
'Variable with id $id not found');
assert(getCurrentStatesVariables[id]!.variable is T,
'Variable with id $id is not of type $T');
return getCurrentStatesVariables[id]!;
}