This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1358,9 +1358,9 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
1358
1358
Orientation _getOrientation (BuildContext context) {
1359
1359
Orientation ? result = MediaQuery .maybeOrientationOf (context);
1360
1360
if (result == null ) {
1361
- // If there's no MediaQuery, then use the window aspect to determine
1361
+ // If there's no MediaQuery, then use the view aspect to determine
1362
1362
// orientation.
1363
- final Size size = WidgetsBinding .instance.window .physicalSize;
1363
+ final Size size = View . of (context) .physicalSize;
1364
1364
result = size.width > size.height ? Orientation .landscape : Orientation .portrait;
1365
1365
}
1366
1366
return result;
Original file line number Diff line number Diff line change @@ -2053,7 +2053,7 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> with Restora
2053
2053
// If screen reader is in use, make the hint text say hours/minutes.
2054
2054
// Otherwise, remove the hint text when focused because the centered cursor
2055
2055
// appears odd above the hint text.
2056
- final String ? hintText = MediaQuery .accessibleNavigationOf (context) || WidgetsBinding .instance.window .semanticsEnabled
2056
+ final String ? hintText = MediaQuery .accessibleNavigationOf (context) || View . of (context).platformDispatcher .semanticsEnabled
2057
2057
? widget.semanticHintText
2058
2058
: (focusNode.hasFocus ? null : _formattedValue);
2059
2059
Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ abstract class WidgetsBindingObserver {
117
117
/// @override
118
118
/// void initState() {
119
119
/// super.initState();
120
- /// _lastSize = WidgetsBinding.instance.window.physicalSize;
120
+ /// // [View.of] exposes the view from `WidgetsBinding.instance.platformDispatcher.views`
121
+ /// // into which this widget is drawn.
122
+ /// _lastSize = View.of(context).physicalSize;
121
123
/// WidgetsBinding.instance.addObserver(this);
122
124
/// }
123
125
///
@@ -129,7 +131,7 @@ abstract class WidgetsBindingObserver {
129
131
///
130
132
/// @override
131
133
/// void didChangeMetrics() {
132
- /// setState(() { _lastSize = WidgetsBinding.instance.window .physicalSize; });
134
+ /// setState(() { _lastSize = View.of(context) .physicalSize; });
133
135
/// }
134
136
///
135
137
/// @override
@@ -186,7 +188,7 @@ abstract class WidgetsBindingObserver {
186
188
///
187
189
/// @override
188
190
/// void didChangeTextScaleFactor() {
189
- /// setState(() { _lastTextScaleFactor = WidgetsBinding.instance.window .textScaleFactor; });
191
+ /// setState(() { _lastTextScaleFactor = WidgetsBinding.instance.platformDispatcher .textScaleFactor; });
190
192
/// }
191
193
///
192
194
/// @override
You can’t perform that action at this time.
0 commit comments