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

Replace private helper methods with private widgets #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edgarfroes
Copy link

Connection with issue(s)

This PR will resolve a performance problem that has no open issue.

There are private methods that return Widgets instead of Widgets themselves, which makes it impossible for Flutter to identify their address in the build context, thus rebuilding all the widgets inside those methods instead of pointing to the already built widget in the memory and Widget tree.

This PR will FIX this by moving this code to private widgets, while also creating a parent-building structure that will rebuild children widgets only when necessary.

Testing and Review Notes

No tests other than normal smoke tests are required, as this PR changes only issues related to performance.

Sources:
Writing Better Flutter Widgets: How to Choose Between Classes and Functions
Widgets versus helper methods | Decoding Flutter

Screenshots or Videos

Simulator.Screen.Recording.-.iPhone.1.-.2023-09-19.at.17.33.24.mp4

To Do

  • double check the original issue to confirm it is fully satisfied
  • add testing notes and screenshots in PR description to help guide reviewers
  • request the "UX" team perform a design review (if/when applicable)

@edgarfroes
Copy link
Author

@yako-dev any feedback?

@yadaniyil yadaniyil added the enhancement New feature or request label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants