fix(ui): replace ft.run_task with asyncio.create_task for Flet 0.85 - #5
Open
awoni wants to merge 1 commit into
Open
fix(ui): replace ft.run_task with asyncio.create_task for Flet 0.85#5awoni wants to merge 1 commit into
awoni wants to merge 1 commit into
Conversation
Flet 0.85's public API no longer exposes ft.run_task, so both the mount-time effect and every Refresh button raised AttributeError before any view could render. Switch to plain asyncio.create_task(coro), which schedules on the running Flet event loop and does the same job with no Flet-side helper. - use_effect wrapper now returns None explicitly (`asyncio.create_task(load()) and None`) so Flet does not mistake the Task for a cleanup callable. - Button on_click sites schedule `load(force=True)` directly. - radar_view and amedas_view gain the `import asyncio` they didn't need before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flet 0.85's public API no longer exposes ft.run_task, so both the
mount-time effect and every Refresh button raised AttributeError before
any view could render. Switch to plain asyncio.create_task(coro), which
schedules on the running Flet event loop and does the same job with no
Flet-side helper.
(
asyncio.create_task(load()) and None) so Flet does not mistake theTask for a cleanup callable.
load(force=True)directly.import asynciothey didn't needbefore.