github flet-dev/flet v0.86.3

5 hours ago

Improvements

  • An embedded FletApp can now run over the in-process dart_bridge transport instead of a socket. Set url="dartbridge://" and the client allocates a native channel, delivers its port through the new FletApp.on_connect event, and the host serves that port with a FletDartBridgeServer — so a Flet program hosted inside another Flet app (a gallery, a preview) exchanges messages at memcpy speed with no socket file, no TCP port, and no AF_UNIX path-length limit (which broke embedded apps on the iOS simulator, where the container path overflows sun_path). High-throughput DataChannels used by embedded apps (RawImage, MatplotlibChart) get their own dedicated bridge too. The transport is opt-in and falls back to the existing URL-scheme channels: on web and desktop dev builds, where dart_bridge is unavailable, hosts keep using a socket URL by @FeodorFitsner.

  • flet run can now pass custom arguments to your app script: everything after a -- separator is forwarded to the script instead of being parsed by Flet, and arrives there as sys.argv[1:] - e.g. flet run --web main.py -- --dataset big.csv --verbose. Previously there was no way to do this: the app was always launched as python -u <script> with no extra arguments, so a flag meant for the app was consumed by the CLI's own parser and rejected with flet: error: unrecognized arguments: --verbose. The arguments are re-applied on every hot reload and work in all run modes (desktop, --web, --ios, --android, and -m module invocations). Arguments that don't look like options can be passed without the separator (flet run main.py big.csv), and mistyped Flet options are still reported as errors - now with a hint to use -- when they were meant for the app. See Passing arguments to your app by @FeodorFitsner.

Bug fixes

  • Fix iOS apps built with flet build ipa crashing at startup with Failed to lookup symbol 'serious_python_run': dlsym(RTLD_DEFAULT, serious_python_run): symbol not found. serious_python shipped dart_bridge — which provides the in-process Dart↔Python transport — as a static library linked into the app executable. An iOS executable exports nothing to the dynamic symbol table by default and the release build strips local symbols, so the dlsym lookups that Dart (DynamicLibrary.process()) and Python (import dart_bridge) perform at runtime could not resolve. Only release/archive (device) builds under the Swift Package Manager path were affected — debug and simulator builds don't dead-strip, so the failure did not reproduce there, and Android was never affected (its dart_bridge is a dynamic .so, which exports its symbols). Bumps serious_python to 4.4.0, which ships dart_bridge as a dynamic framework — embedded and signed into the app like Python.xcframework, with its symbols exported — and re-pins the bundled python-build snapshot to 20260726 (dart_bridge 1.5.1 → 1.6.1, Pyodide 3.14 314.0.2 → 314.0.3); the bundled Python versions (3.12.13 / 3.13.14 / 3.14.6) are unchanged by @FeodorFitsner.

  • Fix MatplotlibChart freezing permanently when its platform view is disposed with a frame in flight — the common trigger is switching to another tab inside the app, which races the frame stream: DataChannel.send on a disposed channel silently drops, so the frame's [0xFF] frame-applied ack never arrives and _send_and_wait's unbounded await parks MatplotlibChart._receive_loop — the sole consumer of the frame queue — for the rest of the session, with no exception raised; remounting opens a fresh channel but the stale ack futures were never resolved, so the chart stayed frozen. _capture_channel now resolves all pending ack futures when a new channel is captured (a fresh channel means every pending ack belongs to the disposed one), unparking the producer instantly on remount, and the ack await is bounded by FRAME_ACK_TIMEOUT (5s; a healthy ack lands in milliseconds) — on expiry the frame is dropped and its future removed from the ack FIFO so subsequent acks keep resolving the right entries (#6709, #6710) by @ForsakenDurian.

  • Fix a system/edge-swipe back gesture exiting the whole host app instead of navigating back when it lands on an embedded FletApp (an app rendered inside another Flet app — e.g. a gallery host running example apps in-process). The embedded app's WidgetsApp (MaterialApp/CupertinoApp) ran the default NavigationNotification handler, which reported SystemNavigator.setFrameworkHandlesBack(false) for a nested app that couldn't pop (typically a single-view example) and swallowed the notification, so the OS finished the whole activity on back and the host never got to report that it could pop. An embedded page now lets that notification bubble to the host (which re-reports canHandlePop) and chains a ChildBackButtonDispatcher to the host Router, so a system back propagates to the host and pops the view that embeds it by @FeodorFitsner.

  • Fix page.window.maximized = True intermittently reverting to unmaximized right after startup on macOS, when set in the same patch as page.title (e.g. page.title = "My App"; page.window.maximized = True in main()) by @davidlawson.

  • Fix flet build picking a non-decodable icon/splash image when several files share a base name, producing a machine-dependent NoDecoderForImageFormatException from flutter_launcher_icons. When an app's assets held, say, both icon.png and icon.svg, find_platform_image selected the first match from glob.glob(...) — whose order is filesystem-dependent — so the same app could pick icon.png on one machine and icon.svg on another (SVG is vector and can't be decoded by the raster icon/splash generators), turning a working build into a crash purely based on directory listing order. Candidates are now filtered to formats the generators can actually decode (.svg is dropped everywhere; .icns stays macOS-only and .ico Windows-only) and ranked so a raster image (.png first) always wins, making the choice deterministic across machines. When the only supplied image is an SVG (no raster sibling), it's skipped with a build-log warning and the default Flet icon is used instead of crashing by @FeodorFitsner.

  • Fix modal controls (AlertDialog, CupertinoAlertDialog, BottomSheet, CupertinoBottomSheet) crashing to a black screen with "setState()/markNeedsBuild() called during build" when they close in the same frame that another route or overlay opens — e.g. dismissing a bottom sheet and showing a SnackBar from one handler. The close path popped the route synchronously during build, so the exit animation notified a listener that was mid-build. Each modal now tracks its own ModalRoute and closes it in a post-frame callback, popping that route (never the topmost one); View's confirm-pop pops its own route too, so a modal dismissed in the same tick as a view pop can no longer dismiss the wrong one by @FeodorFitsner.

Full Changelog: v0.86.2...v0.86.3

Don't miss a new flet release

NewReleases is sending notifications on new releases.