titleFieldFromJson function

TitleField titleFieldFromJson(
  1. dynamic json
)

Implementation

TitleField titleFieldFromJson(dynamic json) {
  if (json is Map) {
    final ExternalField externalField = ExternalField.fromJson(json);
    if (externalField.isValid) {
      return externalField;
    }

    final FieldsDecorator fieldsDecorator = FieldsDecorator.fromJson(json);
    if (fieldsDecorator.isValid) {
      return fieldsDecorator;
    }

    final FieldsDivider fieldsDivider = FieldsDivider.fromJson(json);
    if (fieldsDivider.isValid) {
      return fieldsDivider;
    }
  }
  return FieldsDivider(divider: ' ', type: TitleFieldType.fieldsDivider);
}