diff --git a/sites/docs/src/content/release/breaking-changes/index.md b/sites/docs/src/content/release/breaking-changes/index.md index faf786e9b7..116491f607 100644 --- a/sites/docs/src/content/release/breaking-changes/index.md +++ b/sites/docs/src/content/release/breaking-changes/index.md @@ -39,10 +39,12 @@ They're sorted by release and listed in alphabetical order: * [Added enabled property and made onChanged optional for DropdownButton][] * [Migrate to standalone `material_ui` and `cupertino_ui` packages][] * [Restrict command-line flags for prebuilt Android release binaries][] +* [Removal of `useInheritedMediaQuery`][] [Added enabled property and made onChanged optional for DropdownButton]: /release/breaking-changes/dropdownbutton-enabled-property [Migrate to standalone `material_ui` and `cupertino_ui` packages]: /release/breaking-changes/material-ui-and-cupertino-ui [Restrict command-line flags for prebuilt Android release binaries]: /release/breaking-changes/restrict-command-line-flags-prebuilt-android-release-binaries +[Removal of `useInheritedMediaQuery`]: /release/breaking-changes/remove-useInheritedMediaQuery ### Released in Flutter 3.47 diff --git a/sites/docs/src/content/release/breaking-changes/remove-useInheritedMediaQuery.md b/sites/docs/src/content/release/breaking-changes/remove-useInheritedMediaQuery.md new file mode 100644 index 0000000000..76abaa3fcc --- /dev/null +++ b/sites/docs/src/content/release/breaking-changes/remove-useInheritedMediaQuery.md @@ -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
+In stable release: TBD + +## 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 +[PR 193146]: {{site.repo.flutter}}/pull/193146 +[PR 12970]: {{site.repo.packages}}/pull/12970 +[PR 12969]: {{site.repo.packages}}/pull/12969 \ No newline at end of file