Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
APACHE-2.0 License
Bot releases are hidden (Show)
Published by FeodorFitsner about 2 years ago
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)
page
properties to control window appearance and behaviorpage.window_close()
page.window_title_bar_hidden
page.window_title_bar_buttons_hidden
(macOS only)page.window_skip_task_bar
page.window_frameless
page.window_progress_bar
page.window_visible
New WindowDragArea
class to enable dragging/maximizing/restoring window without a title bar.
New Stack
properties:
Stack.clip_behavior
- none
, antiAlias
, antiAliasWithSaveLayer
, hardEdge
.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
New page
properties:
web
- True
if the app running in the browser.platform
- operating system where the app is running: windows
, macos
, linux
, ios
and android
.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 = theme
Possible values: fadeUpwards
, openUpwards
, zoom
, cupertino
.
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Blog announcement: https://flet.dev/blog/gradients-button-textfield-style
Container
properties:
gradient
on_long_press
ElevatedButton
, OutlinedButton
, TextButton
properties:
style
on_long_press
IconButton
properties:
selected
selected_icon
selected_icon_color
style
ListTile
properties:
on_long_press
Theme
properties:
visual_density
: standard
(default), compact
, comfortable
, adaptivePlatformDensity
.hidden
value for Column
, Page
, View
, Row
and View
controls - to enable scrolling but hide a scrollbar.TextField
and Dropdown
properties:
text_size
color
bgcolor
border_radius
border_width
border_color
focused_color
focused_bgcolor
focused_border_width
focused_border_color
TextField
properties:
max_length
capitalization
- none
(default), characters
, words
, sentences
.cursor_color
selection_color
beta
channel.Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner about 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
page.pwa
property to detect if an app is running as PWA (#58)Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago
Published by FeodorFitsner over 2 years ago