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

User Controls #25

Closed
FeodorFitsner opened this issue Jun 13, 2022 · 1 comment
Closed

User Controls #25

FeodorFitsner opened this issue Jun 13, 2022 · 1 comment
Labels
enhancement Improvement/Optimization

Comments

@FeodorFitsner
Copy link
Contributor

FeodorFitsner commented Jun 13, 2022

User control (UserControl) allows building re-usable components by combining existing Flet controls. User control behaves like a Control, could have methods and properties.

User control has lifecycle methods:

  • did_mount() - called after the UserControl added to a page and assigned transient id.
  • will_unmount() - called before the UserControl is removed from the page.

UserControl is inhrited from Stack control and allows multiple children.

UserControl is isolated from outside layout, i.e. when update() method is called for the parent control any changes inside the UserControl are not included into the update digest. UserControl should call self.update() to push its changes to a Flet page.

@FeodorFitsner FeodorFitsner added the enhancement Improvement/Optimization label Jun 13, 2022
@FeodorFitsner
Copy link
Contributor Author

It's been implemented and documented here: https://flet.dev/docs/getting-started/python#user-controls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement/Optimization
Projects
None yet
Development

No branches or pull requests

1 participant