expandGenerators method

String? expandGenerators(
  1. Sqlite annotation, {
  2. required FieldElement field,
  3. required SharedChecker<Model> checker,
})
inherited

Convert placeholders in fromGenerator and toGenerator to functions.

Implementation

String? expandGenerators(
  FieldAnnotation annotation, {
  required FieldElement field,
  required SharedChecker checker,
}) {
  final name = providerNameForField(annotation.name, checker: checker);

  if (doesDeserialize && annotation.fromGenerator != null) {
    return digestPlaceholders(annotation.fromGenerator, name, field.name);
  }

  if (!doesDeserialize && annotation.toGenerator != null) {
    return digestPlaceholders(annotation.toGenerator, name, field.name);
  }

  return null;
}