setField method
void
setField(
- O o,
- String key,
- Object? value, {
- EntityHandler<
O> ? entityHandler, - EntityCache? entityCache,
Implementation
void setField(O o, String key, Object? value,
{EntityHandler<O>? entityHandler, EntityCache? entityCache}) {
if (o is Entity) {
o.setField(key, value);
} else if (entityHandler != null) {
entityHandler.setField(o, key, value, entityCache: entityCache);
} else if (o is Map) {
o[key] = value;
} else {
throw StateError('setField($key): No EntityHandler provided for: $o');
}
}