ResourceSchema.fake constructor

ResourceSchema.fake()

Shape-only resource for skeleton loading: the UI renders this while LoadStatus.loading, so the skeleton matches the real card's geometry.

Implementation

factory ResourceSchema.fake() {
  return ResourceSchema(
    key: 'fake',
    labels: const ResourceLabels(singular: '—', plural: '—'),
    card: const CardLayout(
      titleField: 'title',
      subtitleField: 'subtitle',
      meta: [CardMeta(field: 'meta')],
    ),
    form: [
      SchemaComponent.fromJson(const {
        'type': 'text',
        'name': 'title',
        'label': '—',
      }, 'fake.form[0]'),
      SchemaComponent.fromJson(const {
        'type': 'text',
        'name': 'subtitle',
        'label': '—',
      }, 'fake.form[1]'),
    ],
  );
}