getFieldHostDatatype function

HostDatatype getFieldHostDatatype(
  1. NamedType field,
  2. List<Class> classes,
  3. List<Enum> enums,
  4. String? builtinResolver(
    1. TypeDeclaration
    ), {
  5. String customResolver(
    1. String
    )?,
})

Calculates the HostDatatype for the provided NamedType.

It will check the field against classes, the list of custom classes, to check if it is a builtin type. builtinResolver will return the host datatype for the Dart datatype for builtin types.

customResolver can modify the datatype of custom types.

Implementation

HostDatatype getFieldHostDatatype(NamedType field, List<Class> classes,
    List<Enum> enums, String? Function(TypeDeclaration) builtinResolver,
    {String Function(String)? customResolver}) {
  return _getHostDatatype(field.type, classes, enums, builtinResolver,
      customResolver: customResolver, fieldName: field.name);
}