flet-cli

raw JSON →
0.84.0 verified Mon Apr 27 auth: no python

Command-line interface for Flet, a Python framework for building real-time web, desktop, and mobile apps. Current version 0.84.0, actively developed with frequent releases.

pip install flet-cli
error ModuleNotFoundError: No module named 'flet'
cause flet package not installed, only flet-cli.
fix
pip install flet
error flet: command not found
cause flet-cli not installed or not in PATH.
fix
pip install flet-cli and ensure Python scripts directory is in PATH.
error TypeError: app() missing 1 required positional argument: 'target'
cause Code uses deprecated positional argument for target.
fix
Change ft.app(main) to ft.app(target=main).
breaking In flet 0.23.0, ft.app() required the 'target' keyword argument; positional arguments deprecated and removed.
fix Use ft.app(target=main) instead of ft.app(main).
deprecated The flet build command is being replaced by flet pack in future versions.
fix Use 'flet pack' instead of 'flet build'.
gotcha Running flet run on mobile emulator requires --ios or --android flag; otherwise defaults to web.
fix Use 'flet run --ios' or 'flet run --android' to specify target platform.
pip install flet-cli==0.84.0

Create a minimal Flet app. Save as hello.py and run with 'flet run hello.py' (web) or 'flet run hello.py --ios' for mobile.

import flet as ft

def main(page: ft.Page):
    page.title = 'Flet app'
    page.add(ft.Text('Hello, Flet!'))

ft.app(target=main)