Skip to content

Optimize MediaQuery usage to prevent unnecessary rebuilds #61

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

Closed
wants to merge 1 commit into from

Conversation

Meshkat-Shadik
Copy link

Description:

In this PR, I've optimized the way we access MediaQuery properties by using MediaQuery.propertyOf instead of relying on the traditional MediaQuery.of(context) method. This ensures that we get the latest MediaQuery data without triggering unnecessary rebuilds across the app, improving performance as highlighted in the Flutter team's best practices video here.

Changes:

  • Replaced MediaQuery.of(context) with MediaQuery.propertyOf in relevant places.
  • Updated affected widgets/components to ensure they receive the latest MediaQuery data while maintaining optimal performance.

@Meshkat-Shadik
Copy link
Author

closing as #54 is the same as I want to do!

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

Successfully merging this pull request may close these issues.

1 participant