Flet app workflow
Skill brunobrown/claude-flet-plugin/.agents/skills/flet-app-workflow
Guided workflow for building a Flet declarative app from scratch (Flet 0.85.x+).From its SKILL.md
npx -y skills add brunobrown/claude-flet-plugin --skill flet-app-workflowAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, as published. Nobody here has run it
Flet App Workflow
You are guiding the user through building a Flet declarative app step by step. Follow these 5 phases in order.
Before starting, confirm the app's purpose and target platforms with the user.
Phase 1: Requirements
Ask the user about:
- App purpose — What does the app do?
- Target platforms — Web, mobile (Android/iOS), desktop (macOS/Windows/Linux)?
- Pages needed — List the main screens/pages
- External services — Any Flet extensions or APIs needed?
- State shape — What data needs to be shared across pages?
Summarize the requirements before proceeding.
Phase 2: Project Setup
For non-trivial apps, use the Clean Architecture layout (mirrors Flutter's
lib/ convention, validated in production Flet apps). For 1–2-page prototypes,
use the flat fallback below.
Clean Architecture (recommended)
my_app/
├── assets/ # fonts/, icons/, images/
├── config.py # Project-root config
├── pyproject.toml # [tool.flet.app] path = "src"
├── tests/ # conftest.py, unit/, widget/, integration/
└── src/
├── main.py # ft.run(create_app, assets_dir="assets")
├── app.py # create_app(page): theme, DI, page.render_views(...)
├── core/ # constants.py, enums.py, exceptions.py, logger.py
├── data/ # sources/, models/, repositories/
├── domain/ # entities/, repositories/, services/, usecases/
├── presentation/ # components/, pages/, navigation/, themes/, hooks/, state_management/
├── services/ # api_service.py, storage_service.py, ...
└── utils/ # validators.py, text_utils.py, ...
Flat (prototype / very small app)
my_app/
├── pyproject.toml # [tool.flet.app] path = "src"
└── src/
├── main.py
├── config.py
├── state.py
├── context.py
├── components/
│ └── __init__.py
└── pages/
└── __init__.py
- Create
pyproject.tomlwith Flet dependency and[tool.flet.app] path = "src" - Create
state.py(orsrc/presentation/state_management/global_providers.pyin the layered layout) with@ft.observable @dataclass AppStatebased on requirements - Create
context.py(or co-locate instate_management/) withAppContextandAppCtx = ft.create_context(None) - Create
config.pyat project root (orsrc/core/constants.pyfor code-level constants) with app configuration and navigation defaults
Phase 3: UI & Pages
For each page identified in Phase 1:
- Create a
@ft.componentfunction inpages/<name>.py - Use
ft.use_context(AppCtx)to access state and services - Use
ft.use_state()for local form fields - Implement async handlers with try/except
- Register in
pages/__init__.pyPAGE_BUILDERS dict
Create reusable components in components/:
- Navigation drawer (if multi-page)
- Log viewer, status bar, or other shared UI
Phase 4: Logic & State
- Wire up
main.py:- Create state outside components
- Initialize services with event handlers
- Add services to
page.services - Call
page.render_views(App, state, ...services)
- Implement the
Approot component:- Create
AppContextwith state + services - Build
ft.ViewwithAppBar, drawer, andPageContent - Use
view_refpattern for drawer - Provide context via
AppCtx(ctx, build_view)
- Create
- Implement
PageContentcomponent:- Read
state.current_pagefrom context - Render corresponding page from
PAGE_BUILDERS
- Read
Phase 5: Polish & Test
- Test locally:
flet run srcorcdto project root andflet run - Add theming:
page.theme = ft.Theme(color_scheme_seed=ft.Colors.BLUE) - Add responsive layout: Use
ft.ResponsiveRowor breakpoint-based layouts - Error handling: Wrap service calls in try/except
- Build for target platforms:
flet build web,flet build apk, etc.
Reminders
- Always use
ft.run(main)— neverft.app() - Always use declarative mode — no
page.add()orpage.update() @ft.observableBEFORE@dataclass(order matters)ft.use_statefor form fields,@ft.observablefor shared state- Factory function for handlers in loops
cleanup=parameter inuse_effect, not return value