pypi flet 0.86.2
v0.86.2

14 hours ago

Bug fixes

  • Fix code edits not taking effect under flet debug android: after re-running the command, the app kept executing the previously-unpacked, stale code instead of your changes. flet debug rebuilds and reinstalls the same-version APK on each iteration (flutter run does an update install that preserves app data), and serious_python's on-device extraction cache — keyed only on versionName+versionCode — never saw the version change, so it skipped re-unpacking the new app.zip. Bumps serious_python to 4.3.4, which folds the APK's lastUpdateTime into that cache key so every (re)install re-extracts the current code while ordinary relaunches still hit the cache. flet build apk was never affected (#6682) by @FeodorFitsner.
  • Fix an embedded FletApp (an app rendered inside another Flet app — e.g. a preview or gallery host that runs example apps in-process) not refreshing its UI in response to events. Auto-update mode was tracked as components_mode on a single process-global context singleton, so a host app that rendered via page.render/page.render_views turned components mode on process-wide and context.auto_update_enabled() then returned False for the embedded app too — any handler that mutated a control without calling .update() (the common imperative style, including all page.services sensor readings) silently never re-rendered. Event dispatch also ran in a fresh task whose page context var could carry a different session's page, so context-derived state resolved against the wrong session. components_mode is now stored per-Session, and Session.dispatch_event binds the page context to its own session before invoking handlers, so multiple Flet apps sharing one process keep independent update behavior by @FeodorFitsner.
  • Modernize examples for 0.86: replace the removed TextField.error_text with error (chat tutorial, mind_queue, palette_editor), and declare the device permissions each sensor example needs to run on-device — NSMotionUsageDescription on iOS for the motion/barometer sensors and android.permission.VIBRATE for HapticFeedback by @FeodorFitsner.
  • Fix opening a flet run --ios / --android app URL in a desktop browser: the page loaded but stayed on the boot screen, endlessly retrying a WebSocket connection to ws://<host>:<port>/ws. Mobile-mode apps are mounted under a non-root path (e.g. /counter/main.py), so the real WebSocket route lives at /counter/main.py/ws - but since 1.0 Alpha the FastAPI wrapper always passed the bare default ws endpoint name into FletStaticFiles, bypassing its mount-path-aware fallback, and index.html got patched with flet.webSocketEndpoint="ws", which the web client resolves against the server root. The native iOS/Android client derives the path from the page URL and was unaffected. A relative WebSocket endpoint is now resolved against the app mount path when patching index.html, fixing browser access to any Flet web app mounted under a non-root path (--ios/--android, flet run --name, or a flet_web.fastapi app mounted at a sub-path) by @FeodorFitsner.
  • Fix web RawImage and MatplotlibChart animations flooding the console with uncatchable engine exceptions (and breaking the animation) after the browser tab was backgrounded for a while and then refocused. On Flet web the frame producer runs in a Pyodide worker (or on a remote server over a WebSocket) that the browser never throttles, while the client's Flutter frame pipeline is suspended whenever the tab is hidden - so setState schedules frames that never paint and the post-frame callbacks that dispose replaced ui.Images never fire. Decoded images and pending disposals then pile up unbounded in the Dart heap and flush into the engine all at once on resume, one exception per queued frame. This is a client-side accumulation independent of transport, so it also affected native windows minimized with an animation running. Fixed in two layers: (1) a shared FrameStreamVisibility client-side mixin - used by both RawImage and flet-charts' MatplotlibChartCanvas - stops decoding/uploading and frees replaced images immediately while hidden (keeping only cheap offscreen state up to date, so incremental matplotlib diffs stay correct), then presents just the latest frame on resume; (2) a new page.wait_until_visible() gate (driven by on_app_lifecycle_state_change, alongside a page.app_visible property) that the streaming controls await internally, so producer loops park while hidden instead of rendering frames a suspended client can only discard (#6691) by @FeodorFitsner.
  • Fix flet build / flet publish flooding non-interactive logs (CI, cloud build, any piped stdout) with thousands of progress-spinner frames, and fix the --no-rich-output flag not actually producing plain output. The CLI's rich Console was created with force_terminal=True whenever the FLET_CLI_NO_RICH_OUTPUT env var was unset, which forces the Live status spinner to repaint even when stdout isn't a TTY — so in a pipe every animation frame lands on its own line (e.g. hundreds of ( ● ) Initializing web build... lines). And the --no-rich-output CLI flag never reached that console at all: it's parsed per-command, after the module-level console is already built, so it only suppressed emojis while color and the spinner kept going. Now the console auto-detects the terminal (force_terminal=None) — interactive terminals keep the animated spinner while piped output stays quiet — and both FLET_CLI_NO_RICH_OUTPUT and --no-rich-output (detected from sys.argv at import) force fully plain output by @FeodorFitsner.

Improvements

  • Flutter updated to 3.44.7.
  • Fix flet_video.Video resetting its volume (and pitch, playback_rate, shuffle_playlist, playlist_mode, subtitle_track) to the player's defaults after toggling visible off then on — e.g. volume jumped back to 100. Hiding a Video disposes its native media_kit player and showing it recreates a fresh one at default settings; the "last-applied" tracking now lives with the player (not the persistent control model) and is reset on recreation, so build() re-applies every setting to the new player (#6683, #6694) by @ndonkoHenri.
  • Fix SearchBar.on_tap_outside_bar not firing when the user tapped outside the open search view. That case now has a dedicated SearchBar.on_tap_outside_view event (fired when tapping outside the open view, e.g. to dismiss it), and on_tap_outside_bar is documented to match what it actually does: fire while the bar is focused and the view is closed, like TextField.on_tap_outside (#6593, #6697) by @ndonkoHenri.
  • Add a --android-legacy-packaging flag (and [tool.flet.android].legacy_packaging setting) to flet build apk/aab for opting into legacy Android native-library packaging. By default (modern packaging), native .so files are stored uncompressed and page-aligned in the APK and memory-mapped directly at runtime, which typically gives a smaller install and Play Store download but a larger raw .apk file. Enabling this option sets useLegacyPackaging = true so the .so are compressed inside the APK and extracted to disk on install: the raw .apk file is smaller (handy when side-loading), at the cost of a larger on-device install and slower native-library loading. The extraction directory is exposed to Python as ANDROID_NATIVE_LIBRARY_DIR, which can help custom native-library consumers that require a real filesystem path. See Native library packaging by @FeodorFitsner.

Full Changelog: v0.86.1...v0.86.2

Don't miss a new flet release

NewReleases is sending notifications on new releases.