serdesValueForField method
- @protected
- FieldElement field,
- String annotatedName, {
- required SharedChecker<
Model> checker,
inherited
The field's value when used by the generator.
For example, data['my_field']
when used by a deserializing generator
or instance.myField
when used by a serializing generator
Implementation
@protected
String serdesValueForField(
FieldElement field,
String annotatedName, {
required SharedChecker checker,
}) {
if (doesDeserialize) {
final name = providerNameForField(annotatedName, checker: checker);
return "data['$name']";
}
return 'instance.${field.name}';
}