ignoreCoderForField method
Determine whether this field should be included in generated output.
Implementation
@override
bool ignoreCoderForField(field, annotation, checker) {
if (annotation.columnType != null) {
if (checker.isSerializable) return false;
if (doesDeserialize) {
if (annotation.fromGenerator == null) {
throw InvalidGenerationSourceError(
'Decalaring column type ${annotation.columnType} on ${field.name} requires `fromGenerator` to be declared',
);
}
} else {
if (annotation.toGenerator == null) {
throw InvalidGenerationSourceError(
'Decalaring column type ${annotation.columnType} on ${field.name} requires `toGenerator` to be declared',
);
}
}
return false;
}
return super.ignoreCoderForField(field, annotation, checker);
}