flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.

APACHE-2.0 License

Downloads
692.1K
Stars
9.5K
Committers
66

Bot releases are hidden (Show)

flet - v0.1.53

Published by FeodorFitsner about 2 years ago

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_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.

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 - True if the app running in the browser.
  • platform - operating system where the app is running: windows, macos, linux, ios and android.

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 = theme

Possible values: fadeUpwards, openUpwards, zoom, cupertino.

flet - v0.1.52

Published by FeodorFitsner about 2 years ago

Changelog

  • e8430b2 RouteChangeEvent, ViewPopEvent
flet - v0.1.51

Published by FeodorFitsner about 2 years ago

Changelog

  • 454be8f Fix container click event data object (#198)
  • 6e77f58 Fix #196 bgcolor has no effect if FAB has a custom content
  • 72c05bc Fix client download on windows
  • 6345546 Bump Flet version to 0.1.50
flet - v0.1.50

Published by FeodorFitsner about 2 years ago

Changelog

  • 5aeebdf Linux ARM64 support for Flet runner app (#189)
  • 47935c1 Bugfix: Image control attribute src_base64 accepts str now (#187)
  • 2a0a08c ContainerTapEventData
  • 75ca6c2 Accessibility fixes (#179)
  • 90e880c Fix button style updates
flet - v0.1.49

Published by FeodorFitsner about 2 years ago

Changelog

  • 73fc309 Fix #173 - ValueError: mutable default
  • a41c564 Bump Flet 0.1.48 [skip ci]
flet - v0.1.48

Published by FeodorFitsner about 2 years ago

Changelog

  • c7f337b Fix container blend mode
flet - v0.1.47

Published by FeodorFitsner about 2 years ago

Changelog

  • 964924d Remove SnackBar.elevation
  • 905b4ff Implicit animations and AnimatedSwitcher control (#162)
  • f4967b7 Markdown and ShaderMask controls (#160)
  • b38b345 Add slugify to utils (#154)
  • 9fa4839 Bump Fletd [skip ci]
flet - v0.1.46

Published by FeodorFitsner about 2 years ago

Blog announcement: https://flet.dev/blog/gradients-button-textfield-style

What's new

  • New Container properties:
    • gradient
    • on_long_press
  • New ElevatedButton, OutlinedButton, TextButton properties:
    • style
    • on_long_press
  • New IconButton properties:
    • selected
    • selected_icon
    • selected_icon_color
    • style
  • New ListTile properties:
    • on_long_press
  • New 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.
  • New TextField and Dropdown properties:
    • text_size
    • color
    • bgcolor
    • border_radius
    • border_width
    • border_color
    • focused_color
    • focused_bgcolor
    • focused_border_width
    • focused_border_color
  • New TextField properties:
    • max_length
    • capitalization - none (default), characters, words, sentences.
    • cursor_color
    • selection_color

Bug fixes

Other changes

flet - v0.1.43

Published by FeodorFitsner about 2 years ago

Changelog

  • 133d75f Switching between "hash" and "path" routing URL strategy (#110)
  • f39312b Update readme
flet - v0.1.42

Published by FeodorFitsner about 2 years ago

Changelog

  • 36eea30 Navigation and Routing (#95)
flet - v0.1.41

Published by FeodorFitsner over 2 years ago

Changelog

  • 705bf0f Fix draggable.content_when_dragging
flet - v0.1.40

Published by FeodorFitsner over 2 years ago

Changelog

  • e21c6bf Drag and Drop (#62)
  • c7333dc Any control can be positioned absolutely inside Stack (#60)
  • b3763a6 Clickable Container (#59)
  • ce4d44f Added page.pwa property to detect if an app is running as PWA (#58)
flet - v0.1.39

Published by FeodorFitsner over 2 years ago

Changelog

  • 34d85ba Fix UserControl _build() call (#52)
flet - v0.1.38

Published by FeodorFitsner over 2 years ago

Changelog

  • 2f53942 Window Manager fix for Linux (#44)
flet - v0.1.37

Published by FeodorFitsner over 2 years ago

Changelog

  • 0e617fe Controlling application window (#39)
flet - v0.1.36

Published by FeodorFitsner over 2 years ago

Changelog

  • f743acb Page events allow multiple subscribers (#38)
  • c30be7a page.rtl to control text directionality (#37)
flet - v0.1.35

Published by FeodorFitsner over 2 years ago

Changelog

  • 5abe464 Fix web_renderer arg
  • ac39008 Default webrenderer is canvaskit
flet - v0.1.34

Published by FeodorFitsner over 2 years ago

Changelog

  • c3b2f38 support "assets" dir for "onefile" PyInstaller
  • 846bd79 Try packaging bin as data
  • b7b9fb1 PyInstaller integration (#34)
flet - v0.1.33

Published by FeodorFitsner over 2 years ago

Changelog

  • 3eed963 Update control itself when isolated (#31)
flet - v0.1.32

Published by FeodorFitsner over 2 years ago

Changelog

  • 90ddef6 Linux runner (#29)