Skip to content

fix: allow MediaQuery copyWith in dedicated methods lint - #134

Merged
riscait merged 1 commit into
mainfrom
codex/media-query-copy-with
Sep 30, 2026
Merged

riscait merged 1 commit into
mainfrom
codex/media-query-copy-with

Conversation

@riscait

@riscait riscait commented Sep 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Allow MediaQuery.of(context).copyWith(...) and MediaQuery.maybeOf(context)?.copyWith(...) because copying the complete MediaQueryData has no dedicated accessor equivalent.
  • Keep reporting property reads such as MediaQuery.of(context).size, including when a later property has a copyWith method.
  • Document the exception and add regression tests.

Verification

  • dart test packages/altive_lints_plugin/test/src/lints/prefer_dedicated_media_query_methods_test.dart (10 passed)
  • dart analyze packages/altive_lints_plugin/lib/src/lints/prefer_dedicated_media_query_methods.dart packages/altive_lints_plugin/test/src/lints/prefer_dedicated_media_query_methods_test.dart
  • dart format --output=none --set-exit-if-changed on the changed Dart files
  • git diff --check

@riscait
riscait requested a review from a team as a code owner September 30, 2026 03:15
@riscait
riscait requested review from k-nkmr and removed request for a team September 30, 2026 03:15
@riscait
riscait merged commit 284afef into main Sep 30, 2026
1 check passed
@riscait
riscait deleted the codex/media-query-copy-with branch September 30, 2026 04:47
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