externalFormFieldToEntity static method

ExternalFormField externalFormFieldToEntity(
  1. DynamicFieldsResponse response
)

Implementation

static domain.ExternalFormField externalFormFieldToEntity(
  infra.DynamicFieldsResponse response,
) =>
    domain.ExternalFormField(
      id: response.data.id,
      externalAction: response.data.externalAction,
      field: response.data.fields
          .map(
            (f) => domain.FieldEntityField(
              fieldType: f.fieldType,
              typeValue: f.typeValue,
              name: f.name,
              label: f.label,
              helpText: f.helpText,
              placeholder: f.placeholder,
              defaultValue: f.defaultValue,
              requiredField: f.requiredField,
              uniqueField: f.uniqueField,
              format: f.format,
              choices: f.choices
                  ?.map((c) => domain.ChoiceField(label: c.label, value: c.value))
                  .toList(),
              properties: f.properties,
            ),
          )
          .toList(),
    );