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

perf: avoid MediaQuery.of #1112

Merged
merged 2 commits into from
Feb 9, 2024
Merged

perf: avoid MediaQuery.of #1112

merged 2 commits into from
Feb 9, 2024

Conversation

EchoEllet
Copy link
Contributor

For example, instead of MediaQuery.of(context).size now we will use MediaQuery.sizeOf(context)

Which will listen for only size changes to reduce the rebuilds and help improving the performance

@EchoEllet
Copy link
Contributor Author

@adil192 This is pretty easy PR to merge or reject, it doesn't change much, it could help with performance a little

@adil192 adil192 changed the title Improve usage of MediaQuery perf: avoid MediaQuery.of(context) Feb 9, 2024
@adil192 adil192 changed the title perf: avoid MediaQuery.of(context) perf: avoid MediaQuery.of Feb 9, 2024
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (446f4d2) 37.28% compared to head (bd6a76d) 37.29%.

Files Patch % Lines
lib/components/canvas/canvas_gesture_detector.dart 50.00% 1 Missing ⚠️
lib/components/home/preview_card.dart 0.00% 1 Missing ⚠️
lib/components/navbar/responsive_navbar.dart 0.00% 1 Missing ⚠️
lib/components/settings/settings_selection.dart 0.00% 1 Missing ⚠️
lib/components/theming/sliver_width_box.dart 0.00% 1 Missing ⚠️
lib/components/toolbar/editor_page_manager.dart 0.00% 1 Missing ⚠️
lib/pages/editor/editor.dart 66.66% 1 Missing ⚠️
lib/pages/home/browse.dart 0.00% 1 Missing ⚠️
lib/pages/home/home.dart 0.00% 1 Missing ⚠️
lib/pages/home/recent_notes.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1112      +/-   ##
==========================================
+ Coverage   37.28%   37.29%   +0.01%     
==========================================
  Files         108      108              
  Lines        8479     8478       -1     
==========================================
+ Hits         3161     3162       +1     
+ Misses       5318     5316       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adil192 adil192 merged commit 9a54701 into saber-notes:main Feb 9, 2024
2 checks passed
@adil192
Copy link
Member

adil192 commented Feb 9, 2024

Thanks!

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.

2 participants