Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Control.on_update to Control.before_update #2642

Closed
yunguangli opened this issue Feb 15, 2024 · 3 comments · Fixed by #2659
Closed

Rename Control.on_update to Control.before_update #2642

yunguangli opened this issue Feb 15, 2024 · 3 comments · Fixed by #2659
Assignees
Labels
bug Something isn't working

Comments

@yunguangli
Copy link

Dismissible example in the documentation doesn't work in Flet 0.20.0

Code example to reproduce the issue:

(paste your program here)

TypeError: EventHandler.__sync_handler() missing 1 required positional argument: 'e'

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

flet 0.20.0

(paste your output here)

Give your requirements.txt file (don't pip freeze, instead give direct packages):

(The requirements)

Operating system:

Windows 11

@ndonkoHenri
Copy link
Contributor

Please can you fill up the bug/issue template with all necessary details.

@ndonkoHenri ndonkoHenri added status: invalid Incomplete or invalid status: awaiting response Further information is requested labels Feb 15, 2024
@yunguangli
Copy link
Author

I simply copied the example in the documentation and ran it under Flet 0.20.0 and Windows 11. Here is the complete error log:

File "C:\PyProjects\venv\Lib\site-packages\flet_runtime\app.py", line 357, in on_session_created
session_handler(page)
File "c:\PyProjects\test.py", line 40, in main
page.add(
File "C:\PyProjects\venv\Lib\site-packages\flet_core\page.py", line 315, in add
r = self.__update(self)
^^^^^^^^^^^^^^^^^^^
File "C:\PyProjects\venv\Lib\site-packages\flet_core\page.py", line 431, in __update
commands, added_controls, removed_controls = self.__prepare_update(*controls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PyProjects\venv\Lib\site-packages\flet_core\page.py", line 456, in __prepare_update
control.build_update_commands(
File "C:\PyProjects\venv\Lib\site-packages\flet_core\control.py", line 423, in build_update_commands
innerCmds = ctrl._build_add_commands(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PyProjects\venv\Lib\site-packages\flet_core\control.py", line 480, in _build_add_commands
childCmd = control._build_add_commands(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PyProjects\venv\Lib\site-packages\flet_core\control.py", line 480, in _build_add_commands
childCmd = control._build_add_commands(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PyProjects\venv\Lib\site-packages\flet_core\control.py", line 469, in _build_add_commands
command = self._build_command(False)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PyProjects\venv\Lib\site-packages\flet_core\control.py", line 497, in _build_command
self.on_update()
TypeError: EventHandler.__sync_handler() missing 1 required positional argument: 'e'

@yunguangli
Copy link
Author

python 3.12.1

@ndonkoHenri ndonkoHenri added bug Something isn't working and removed status: invalid Incomplete or invalid status: awaiting response Further information is requested labels Feb 16, 2024
@FeodorFitsner FeodorFitsner changed the title Dismissible example doesn't work in Flet 0.20.0 Rename Control.on_update to Control.before_update Feb 16, 2024
@FeodorFitsner FeodorFitsner self-assigned this Feb 16, 2024
@ndonkoHenri ndonkoHenri linked a pull request Feb 16, 2024 that will close this issue
FeodorFitsner added a commit that referenced this issue Feb 17, 2024
* Flutter 3.19.x

* Upgrade Gradle configs

* Do not install Flutter on macOS

* `Control.on_update` renamed to `Control.before_update`

Close #2642

* `Page.design` replaced with `Page.adaptive`

Close #2650

* Fixed scrollbars behavior

* Fixed choosing scaffold based on provided AppBar

* Migrate deprecated keyboard handlers

* Fix deprecated DragTarget.onWillAccept

* Remove unused imports

* Bump version to 0.20.1

* Copy build outputs from multiple locations

Fix #2658

* flet_audio version bumped to 0.20.1
zrr1999 pushed a commit to zrr1999/flet that referenced this issue Jul 17, 2024
* Flutter 3.19.x

* Upgrade Gradle configs

* Do not install Flutter on macOS

* `Control.on_update` renamed to `Control.before_update`

Close flet-dev#2642

* `Page.design` replaced with `Page.adaptive`

Close flet-dev#2650

* Fixed scrollbars behavior

* Fixed choosing scaffold based on provided AppBar

* Migrate deprecated keyboard handlers

* Fix deprecated DragTarget.onWillAccept

* Remove unused imports

* Bump version to 0.20.1

* Copy build outputs from multiple locations

Fix flet-dev#2658

* flet_audio version bumped to 0.20.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants