Kite docs

Adding a resource

List, detail, create and edit are generic. A new resource is a schema entry, not four new screens.

1. Describe it

In lib/features/resources/resource_schema.dart:

'invoices': ResourceSpec(
  name: 'invoices',
  singular: 'Invoice',
  titleField: 'number',              // names the record in headings and breadcrumbs
  statuses: ['Draft', 'Sent', 'Paid', 'Overdue'],
  fields: [
    FieldSpec('number', 'Invoice', ColKind.text, editable: false),
    FieldSpec('client', 'Client', ColKind.text),
    FieldSpec('amount', 'Amount', ColKind.money),
    FieldSpec('due', 'Due', ColKind.text),
    FieldSpec('status', 'Status', ColKind.select,
        options: ['Draft', 'Sent', 'Paid', 'Overdue']),
    FieldSpec('notes', 'Notes', ColKind.longText, inList: false),
  ],
),

2. Route it

Add the name to the loop in lib/core/router/app_router.dart:

for (final resource in const ['orders', 'customers', 'products', 'invoices'])

That generates /invoices, /invoices/new, /invoices/:id and /invoices/:id/edit. Then add a NavItem in routes.dart.

What you get for free

From the specDrives
inListWhich fields become table columns
ColKindColumn type, alignment, formatting, and the edit control
editableWhether the field appears in the create/edit form
statusesThe filter chips on the list toolbar
titleFieldPage heading, breadcrumb, delete confirmation, drawer title
optionsThe select's choices, and its validation

Field kinds

ColKindList columnEdit controlValidation
textText, start-alignedKiteInputNot empty
numberNumber, end-alignedNumeric inputParses as a number
moneyCurrency, end-aligned, numeric sort preservedNumeric inputParses as a number
emailTextEmail keyboardContains @
selectText, tone-coded badge on detailKiteSelectA choice was made
longTextUsually inList: falseKiteTextareaOptional

Currency columns keep their numeric value. They render as $1,264.55 via TrinaColumnType.currency while sorting numerically. Formatting the value into a string instead would sort $9.00 after $1,264.55.

When the generic screens are not enough

They are a starting point, not a cage. If invoices need a line-item editor, write lib/features/invoices/ and route it directly — the schema approach earns its keep on the resources that are genuinely CRUD, and gets out of the way on the ones that are not.