Repository navigation
Commit a111cd0
authored
Support reduceMotion accessibility feature in MediaQuery (flutter#190287)
Exposes the platform's "Reduce Motion" accessibility setting through
MediaQueryData, so widgets can react to it with proper dependency
tracking instead of reading it ad hoc off the platform dispatcher.
The reduceMotion flag tracking the iOS "Reduce Motion" setting already
exists at the engine layer as
`dart:ui.AccessibilityFeatures.reduceMotion`, but it was never surfaced
on MediaQueryData. This mirrors the existing disableAnimations support,
which corresponds to Android's "Remove animations" setting.
Unlike disableAnimations, reduceMotion is not consulted by
framework-level animation APIs such as AnimationController. It is
intended for widgets that want to tone down or replace non-essential
motion, for example, by substituting a cross-fade for a slide.
No engine or SemanticsBinding changes are required: as with
disableAnimations, MediaQueryData reads reduceMotion directly from
platformDispatcher.accessibilityFeatures, and FakeAccessibilityFeatures
already supports the flag.
Issue: flutter#4827
Issue: flutter#65874
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md1 parent cde1532 commit a111cd0
2 files changed
Lines changed: 92 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| |||
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
| 326 | + | |
| 327 | + | |
322 | 328 | | |
323 | 329 | | |
324 | 330 | | |
| |||
692 | 698 | | |
693 | 699 | | |
694 | 700 | | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
695 | 724 | | |
696 | 725 | | |
697 | 726 | | |
| |||
852 | 881 | | |
853 | 882 | | |
854 | 883 | | |
| 884 | + | |
855 | 885 | | |
856 | 886 | | |
857 | 887 | | |
| |||
879 | 909 | | |
880 | 910 | | |
881 | 911 | | |
| 912 | + | |
882 | 913 | | |
883 | 914 | | |
884 | 915 | | |
| |||
927 | 958 | | |
928 | 959 | | |
929 | 960 | | |
| 961 | + | |
930 | 962 | | |
931 | 963 | | |
932 | 964 | | |
| |||
962 | 994 | | |
963 | 995 | | |
964 | 996 | | |
| 997 | + | |
965 | 998 | | |
966 | 999 | | |
967 | 1000 | | |
| |||
1165 | 1198 | | |
1166 | 1199 | | |
1167 | 1200 | | |
| 1201 | + | |
1168 | 1202 | | |
1169 | 1203 | | |
1170 | 1204 | | |
| |||
1193 | 1227 | | |
1194 | 1228 | | |
1195 | 1229 | | |
| 1230 | + | |
1196 | 1231 | | |
1197 | 1232 | | |
1198 | 1233 | | |
| |||
1225 | 1260 | | |
1226 | 1261 | | |
1227 | 1262 | | |
| 1263 | + | |
1228 | 1264 | | |
1229 | 1265 | | |
1230 | 1266 | | |
| |||
2026 | 2062 | | |
2027 | 2063 | | |
2028 | 2064 | | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
2029 | 2087 | | |
2030 | 2088 | | |
2031 | 2089 | | |
| |||
2273 | 2331 | | |
2274 | 2332 | | |
2275 | 2333 | | |
| 2334 | + | |
2276 | 2335 | | |
2277 | 2336 | | |
2278 | 2337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
211 | 214 | | |
| |||
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| 263 | + | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
| |||
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| 290 | + | |
286 | 291 | | |
287 | 292 | | |
288 | 293 | | |
| |||
331 | 336 | | |
332 | 337 | | |
333 | 338 | | |
| 339 | + | |
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
| |||
401 | 407 | | |
402 | 408 | | |
403 | 409 | | |
| 410 | + | |
404 | 411 | | |
405 | 412 | | |
406 | 413 | | |
| |||
592 | 599 | | |
593 | 600 | | |
594 | 601 | | |
| 602 | + | |
595 | 603 | | |
596 | 604 | | |
597 | 605 | | |
| |||
634 | 642 | | |
635 | 643 | | |
636 | 644 | | |
| 645 | + | |
637 | 646 | | |
638 | 647 | | |
639 | 648 | | |
| |||
654 | 663 | | |
655 | 664 | | |
656 | 665 | | |
| 666 | + | |
657 | 667 | | |
658 | 668 | | |
659 | 669 | | |
| |||
703 | 713 | | |
704 | 714 | | |
705 | 715 | | |
| 716 | + | |
706 | 717 | | |
707 | 718 | | |
708 | 719 | | |
| |||
747 | 758 | | |
748 | 759 | | |
749 | 760 | | |
| 761 | + | |
750 | 762 | | |
751 | 763 | | |
752 | 764 | | |
| |||
791 | 803 | | |
792 | 804 | | |
793 | 805 | | |
| 806 | + | |
794 | 807 | | |
795 | 808 | | |
796 | 809 | | |
| |||
828 | 841 | | |
829 | 842 | | |
830 | 843 | | |
| 844 | + | |
831 | 845 | | |
832 | 846 | | |
833 | 847 | | |
| |||
867 | 881 | | |
868 | 882 | | |
869 | 883 | | |
| 884 | + | |
870 | 885 | | |
871 | 886 | | |
872 | 887 | | |
| |||
901 | 916 | | |
902 | 917 | | |
903 | 918 | | |
| 919 | + | |
904 | 920 | | |
905 | 921 | | |
906 | 922 | | |
| |||
940 | 956 | | |
941 | 957 | | |
942 | 958 | | |
| 959 | + | |
943 | 960 | | |
944 | 961 | | |
945 | 962 | | |
| |||
977 | 994 | | |
978 | 995 | | |
979 | 996 | | |
| 997 | + | |
980 | 998 | | |
981 | 999 | | |
982 | 1000 | | |
| |||
1016 | 1034 | | |
1017 | 1035 | | |
1018 | 1036 | | |
| 1037 | + | |
1019 | 1038 | | |
1020 | 1039 | | |
1021 | 1040 | | |
| |||
1050 | 1069 | | |
1051 | 1070 | | |
1052 | 1071 | | |
| 1072 | + | |
1053 | 1073 | | |
1054 | 1074 | | |
1055 | 1075 | | |
| |||
1089 | 1109 | | |
1090 | 1110 | | |
1091 | 1111 | | |
| 1112 | + | |
1092 | 1113 | | |
1093 | 1114 | | |
1094 | 1115 | | |
| |||
1126 | 1147 | | |
1127 | 1148 | | |
1128 | 1149 | | |
| 1150 | + | |
1129 | 1151 | | |
1130 | 1152 | | |
1131 | 1153 | | |
| |||
1165 | 1187 | | |
1166 | 1188 | | |
1167 | 1189 | | |
| 1190 | + | |
1168 | 1191 | | |
1169 | 1192 | | |
1170 | 1193 | | |
| |||
1199 | 1222 | | |
1200 | 1223 | | |
1201 | 1224 | | |
| 1225 | + | |
1202 | 1226 | | |
1203 | 1227 | | |
1204 | 1228 | | |
| |||
1531 | 1555 | | |
1532 | 1556 | | |
1533 | 1557 | | |
| 1558 | + | |
1534 | 1559 | | |
1535 | 1560 | | |
1536 | 1561 | | |
| |||
1563 | 1588 | | |
1564 | 1589 | | |
1565 | 1590 | | |
| 1591 | + | |
1566 | 1592 | | |
1567 | 1593 | | |
1568 | 1594 | | |
| |||
1610 | 1636 | | |
1611 | 1637 | | |
1612 | 1638 | | |
| 1639 | + | |
1613 | 1640 | | |
1614 | 1641 | | |
1615 | 1642 | | |
| |||
1648 | 1675 | | |
1649 | 1676 | | |
1650 | 1677 | | |
| 1678 | + | |
1651 | 1679 | | |
1652 | 1680 | | |
1653 | 1681 | | |
| |||
1929 | 1957 | | |
1930 | 1958 | | |
1931 | 1959 | | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1932 | 1965 | | |
1933 | 1966 | | |
1934 | 1967 | | |
| |||
0 commit comments