toModel method

  1. @override
Model toModel()
override

Implementation

@override
Model toModel() {
  return Model(
    name: description().title,
    icon: IconPackNames.mdi_format_list_bulleted_square,
    fields: [
      [
        fieldToModelName,
        fieldToModelId,
      ],
      [
        fieldToModelSort,
        fieldToModelShowInList,
        fieldToModelIsRequired,
      ],
      [
        StructuredField(
          id: 'values',
          name: 'Enum values',
          structure: [
            StringField(id: 'title', name: 'Title'),
            StringField(id: 'value', name: 'Value'),
          ],
        ),
      ],
    ],
  );
}