Skip to content

perf: used specialized context utils#3464

Open
omedkane wants to merge 1 commit into
jonataslaw:masterfrom
omedkane:perf/specialized-context-utils
Open

perf: used specialized context utils#3464
omedkane wants to merge 1 commit into
jonataslaw:masterfrom
omedkane:perf/specialized-context-utils

Conversation

@omedkane

@omedkane omedkane commented Jun 16, 2026

Copy link
Copy Markdown

Problem ⚠️

// This will cause rebuilds if any other component of context change like size, viewInsets, etc
MediaQuery.of(context).padding
MediaQuery.of(context).size // Idem
MediaQuery.of(context).viewInsets // Idem

Solution ✅

MediaQuery.paddingOf(context).padding // listens only to padding
MediaQuery.sizeOf(context) // listens only to size
MediaQuery.viewInsetsOf(context) // listens only to viewInsets
// etc

Pre-launch Checklist

  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or @jonataslaw said the PR is test-exempt.
  • All existing and new tests are passing.

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