v0.1.53
Desktop Flet app can be started with a hidden window
New view=flet.FLET_APP_HIDDEN argument - run app with a hidden window on the startup. Window could be made visible from a user code:
import flet
from flet import Container, IconButton, Page, Row, Text, WindowDragArea, icons
def main(page: Page):
page.add(
Row(
[
WindowDragArea(
Container(
Text("This is a window move drag area."),
bgcolor="yellow",
padding=10,
),
expand=1,
),
IconButton(icon=icons.CLOSE, on_click=lambda _: page.window_close()),
]
)
)
page.window_width = 600
page.window_height = 400
page.window_title_bar_hidden = True
page.window_frameless = True
page.window_visible = True
page.window_center()
flet.app(target=main, view=flet.FLET_APP_HIDDEN)New page properties to control window appearance and behavior
page.window_close()page.window_title_bar_hiddenpage.window_title_bar_buttons_hidden(macOS only)page.window_skip_task_barpage.window_framelesspage.window_progress_barpage.window_visible
New WindowDragArea class to enable dragging/maximizing/restoring window without a title bar.
Other changes
New Stack properties:
Stack.clip_behavior-none,antiAlias,antiAliasWithSaveLayer,hardEdge.
Hot reload
For hot-reload run your Python program with flet command line:
usage: flet [-h] [--port PORT] [--directory] [--recursive] [--hidden] [--web] script
Runs Flet app in Python with hot reload.
positional arguments:
script path to a Python script
optional arguments:
-h, --help show this help message and exit
--port PORT, -p PORT custom TCP port to run Flet app on
--directory, -d watch script directory
--recursive, -r watch script directory and all sub-directories recursively
--hidden, -n application window is hidden on startup
--web, -w open app in a web browser
By default, flet watches script file one. Use --directory flag to watch all files in script's directory. Use --recursive flag to watch script directory and all sub-directories recursively.
For example:
flet main.py -d
Platform details
New page properties:
web-Trueif the app running in the browser.platform- operating system where the app is running:windows,macos,linux,iosandandroid.
Customisable route transitions
theme = Theme()
theme.page_transitions.android = "openUpwards"
theme.page_transitions.ios = "cupertino"
theme.page_transitions.macos = "fadeUpwards"
theme.page_transitions.linux = "zoom"
theme.page_transitions.windows = "zoom"
page.theme = themePossible values: fadeUpwards, openUpwards, zoom, cupertino.