Best practices

Start declarative

Use the declarative approach for most screens.

It is simpler and easier to maintain.

Keep classes focused

Each UI class should represent a single screen or concept.

Let Mateu generate

Avoid manually building UI unless necessary.

Lean on Mateu to generate standard patterns.

Use fluent only when needed

Switch to fluent when:

  • you need custom layouts
  • you need more control
  • declarative becomes limiting

Think in state + actions

Design your UI as:

  • state (fields)
  • actions (methods)

This keeps your code simple and predictable.