-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add useInheritedMediaQuery removal breaking change entry and migration guide
#13916
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
Changes from all commits
29a08d4
dc26d36
3a36588
b815d8b
7d02638
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| --- | ||
| title: Remove useInheritedMediaQuery | ||
| description: >- | ||
| The `useInheritedMediaQuery` property has been removed from the Flutter framework. | ||
| --- | ||
|
|
||
| {% render "docs/breaking-changes.md" %} | ||
|
|
||
| ## Summary | ||
|
|
||
| The `useInheritedMediaQuery` properties in `WidgetsApp`, `MaterialApp`, and `CupertinoApp` were removed because these widget never introduced their own MediaQuery, the View widget takes care of that. | ||
|
|
||
| ## Context | ||
|
|
||
| Historically, Flutter used `useInheritedMediaQuery` to determine whether a `WidgetsApp`, `MaterialApp`, or `CupertinoApp` should inherit the `MediaQuery` from its parent. This became redundant when `MediaQuery` inheritance became the default behavior. | ||
|
|
||
| ## Migration guide | ||
|
|
||
| If your code previously used `useInheritedMediaQuery`, you can migrate it by deleting any usage of the property. | ||
|
|
||
| ```dart diff | ||
| - useInheritedMediaQuery: true, | ||
| ``` | ||
|
|
||
| ```dart diff | ||
| - useInheritedMediaQuery: false, | ||
| ``` | ||
|
|
||
| :::important | ||
| This migration isn't supported by `dart fix`. | ||
| ::: | ||
|
|
||
| ## Timeline | ||
|
|
||
| Landed in version: TBD<br> | ||
| In stable release: TBD | ||
|
Comment on lines
+35
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't forget these when ready.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean when the new stable is cut right ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
|
|
||
| ## References | ||
|
|
||
| API documentation: | ||
|
|
||
| * [`WidgetsApp`][] | ||
| * [`MaterialApp`][] | ||
| * [`CupertinoApp`][] | ||
|
|
||
|
|
||
| Relevant PRs: | ||
|
|
||
| * [PR 193146][] | ||
| * [PR 12970][] | ||
| * [PR 12969][] | ||
|
|
||
| [`WidgetsApp`]: {{site.api}}/flutter/widgets/WidgetsApp-class.html | ||
| [`MaterialApp`]: {{site.pub}}/documentation/material_ui/latest/material_ui/MaterialApp-class.html | ||
| [`CupertinoApp`]: {{site.pub}}/documentation/cupertino_ui/latest/cupertino_ui/CupertinoApp-class.html | ||
|
sfshaza2 marked this conversation as resolved.
|
||
| [PR 193146]: {{site.repo.flutter}}/pull/193146 | ||
| [PR 12970]: {{site.repo.packages}}/pull/12970 | ||
| [PR 12969]: {{site.repo.packages}}/pull/12969 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be by using
removeParameterright? What do you think about including a dart fix for this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure how create/edit dart fixes tbh