Imperative to declarative flet

From flet-dev/flet · View interactive version

Imperative to declarative flet is an AI agent skill from the GitHub repository flet-dev/flet. Convert an imperative Flet Python app in which controls are mutated and then page.update is called to declarative style using flet.component, flet.observable and state hooks.

How to use this skill

Skill file

Imperative → Declarative (Flet Python)

Port an existing imperative Flet app to “components mode” with @ft.component, hooks, and (optionally) @ft.observable models.

Outcomes

Choose a state strategy

Workflow

1) Create a new declarative copy

2) Switch to components mode entrypoint

3) Centralize routing in `App`

4) Componentize UI

5) Dialogs: reduce `page.update()` usage

If a dialog mutates existing controls and calls page.update(), convert it to:

6) Assets/fonts checklist

Common pitfalls (and fixes)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.