sdk/python/templates/app/extension/{{cookiecutter.out_dir}}/README.md
{{cookiecutter.project_name}} Flet extension. {% if cookiecutter.description %} {{ cookiecutter.description }} {% endif %}
<!--- If your extension wraps a Flutter package, credit it here, ex: It is based on the [xyz](https://pub.dev/packages/xyz) Flutter package. -->| Platform | iOS | Android | Web | Windows | macOS | Linux |
|---|---|---|---|---|---|---|
| Supported | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Add {{cookiecutter.project_name}} dependency to the pyproject.toml of your Flet project:
dependencies = [
"{{cookiecutter.project_name}} @ git+https://github.com/MY_GITHUB_ACCOUNT/{{cookiecutter.project_name}}",
"flet>={{cookiecutter.flet_version}}",
]
dependencies = [
"{{cookiecutter.project_name}}",
"flet>={{cookiecutter.flet_version}}",
]
A Flet extension has two sides: its Python controls/services and the native Flutter/Dart widgets behind them.
That native code must be compiled into a Flet client before your controls can render, and the
prebuilt client that a plain flet run uses does not include this extension.
So run your app in one of these two ways:
1. flet debug — all platforms: Windows, macOS, Linux, Web, iOS, Android
Compiles the extension and launches your app on the target you pick. The simplest option, and the way to go for mobile and web:
flet debug macos # desktop & web: no device needed
flet debug android -d <device-id> # mobile: connect a device/emulator first
For iOS and Android, pass -d <device-id> (run flet debug --show-devices to list connected devices).
Edits to your Python code are picked up the next time you run flet debug.
2. flet build once, then flet run — desktop only: Windows, macOS, Linux
Build a custom client that bundles the extension once, then use flet run for a fast hot-reload loop while you edit Python:
flet build macos # or: flet build windows / flet build linux
flet run # run from the folder where build/ was created, so it reuses that client
flet run auto-detects the client under build/<platform>/, so your Python edits hot-reload instantly.
Rebuild only when the extension's Dart code changes.
See the examples directory.
Detailed documentation for this package can be found here.