Replies: 2 comments 9 replies
-
what do you think of this: https://github.com/o0Adrian/flet-mvc |
Beta Was this translation helpful? Give feedback.
9 replies
-
I have released a 0.2.0 version of my approach: https://github.com/vindevoy/flet_mvc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I am fond of the MVC pattern. I would like to have this approach in Flet also, but the main problem is the access to controls. If I define a page in a function, as long as I have functions within that function, I can access my controls. But, if I want my page to be in view.py and my logic in controller.py, I simply can't easily access the controls anymore as they are scoped only within the function.
I came up with the following code to add a "name" property via the "data" property. Then, with some helper code, I can have a list of all "named controls" and get access to it that way. The solution is below.
I would appreciate it if somebody shed some light on my approach and if somebody has a similar problem or idea, if you could share your thoughts on this.
Code sample
Error message
No response
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions