Skip to content
Discussion options

You must be logged in to vote

There's no official MVVM framework in Flet (fletx is a third-party project), but since Flet 1.0 added declarative UI, MVVM maps onto the built-in pieces quite naturally, with no extra library:

MVVM Flet 1.0
Model Plain Python classes / services (no Flet imports), easy to unit test
ViewModel An @ft.observable dataclass holding UI state + methods as "commands"
View @ft.component functions that read ViewModel fields and bind events to its methods

When you assign to an observable's fields (or mutate its lists), Flet re-renders the components that read them, so there's no manual page.update() and no binding boilerplate. That's essentially the ViewModel → View data binding you're …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jackhb1999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants