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

Make YaruExpandable and YaruExpansionPanel optionally build children lazily #814

Open
omar-selo opened this issue Dec 13, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request widgets

Comments

@omar-selo
Copy link

omar-selo commented Dec 13, 2023

Right now it seems that even when a YaruExpandable or YaruExpansionPanel are not open, the build method is still called. I noticed this because we had a child widget that made an API request. We expected that API request to only be made when expanded, but it was made immediately (even when closed). Perhaps these Yaru widgets could have a builder attribute that gets called when they're expanded. Of course lazy building might not suit all use cases. But it would be nice to have both options.

@omar-selo
Copy link
Author

omar-selo commented Jan 16, 2024

For comparison this issue isn't present with ExpansionTile. The children attribute don't actually build until they're expanded

@Feichtmeier
Copy link
Member

@Jupi007 could you eventually tackle this? I tried and failed miserably 😆 Repaints were even worse in my branch. I checked with the nice color rebuilds option in flutter dev tools

@Jupi007
Copy link
Member

Jupi007 commented Jan 16, 2024

@Feichtmeier I will look at it :)

@Feichtmeier Feichtmeier added enhancement New feature or request widgets labels Mar 3, 2024
@Feichtmeier Feichtmeier self-assigned this May 1, 2024
Feichtmeier added a commit that referenced this issue May 1, 2024
Feichtmeier added a commit that referenced this issue May 1, 2024
* fix: Make YaruExpansionPanel build lazily

Ref #814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request widgets
Projects
None yet
Development

No branches or pull requests

3 participants