toModel method

  1. @override
Model toModel()
override

Implementation

@override
Model toModel() {
  return Model(
    name: 'Field $name',
    icon: 'key',
    fields: [
      [
        fieldToModelName,
        fieldToModelId,
        StringField(name: 'Binary Data Field ID', id: 'binaryDataFieldId', maxLines: 1),
      ],
      [
        fieldToModelSort,
        fieldToModelShowInList,
        fieldToModelIsRequired,
      ],
      [
        EnumField(
          id: 'screenContentType',
          name: 'Screen Type',
          isRequired: true,
          values: [
            EnumValue(title: 'Scrollable', value: ScreenContentType.scrollable.name),
            EnumValue(title: 'Stack', value: ScreenContentType.stack.name),
          ],
        ),
      ],
    ],
  );
}