ignoreCoderForField method

  1. @protected
bool ignoreCoderForField(
  1. FieldElement field,
  2. Annotation annotation,
  3. SharedChecker<Model> checker
)
inherited

Determine whether this field should be included in generated output.

Implementation

@protected
bool ignoreCoderForField(
    FieldElement field, FieldAnnotation annotation, SharedChecker<Model> checker) {
  final isComputedGetter = FieldsForClass.isComputedGetter(field);

  if (isComputedGetter && doesDeserialize) return true;
  if (annotation.ignore) return true;

  final hasGenerator =
      doesDeserialize ? annotation.fromGenerator != null : annotation.toGenerator != null;
  if (!checker.isSerializable && hasGenerator) return false;

  return !(checker.isSerializable || checker.isSerializableViaJson(doesDeserialize));
}