File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 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
13581358  Orientation  _getOrientation (BuildContext  context) {
13591359    Orientation ?  result =  MediaQuery .maybeOrientationOf (context);
13601360    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 
13621362      // orientation. 
1363-       final  Size  size =  WidgetsBinding .instance.window .physicalSize;
1363+       final  Size  size =  View . of (context) .physicalSize;
13641364      result =  size.width >  size.height ?  Orientation .landscape :  Orientation .portrait;
13651365    }
13661366    return  result;
Original file line number Diff line number Diff line change @@ -2053,7 +2053,7 @@ class _HourMinuteTextFieldState extends State<_HourMinuteTextField> with Restora
20532053    // If screen reader is in use, make the hint text say hours/minutes. 
20542054    // Otherwise, remove the hint text when focused because the centered cursor 
20552055    // 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
20572057        ?  widget.semanticHintText
20582058        :  (focusNode.hasFocus ?  null  :  _formattedValue);
20592059
Original file line number Diff line number Diff line change @@ -117,7 +117,9 @@ abstract class WidgetsBindingObserver {
117117  ///   @override 
118118  ///   void initState() {  
119119  ///     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;  
121123  ///     WidgetsBinding.instance.addObserver(this);  
122124  ///   }  
123125  /// 
@@ -129,7 +131,7 @@ abstract class WidgetsBindingObserver {
129131  /// 
130132  ///   @override 
131133  ///   void didChangeMetrics() {  
132-   ///     setState(() { _lastSize = WidgetsBinding.instance.window .physicalSize; });  
134+   ///     setState(() { _lastSize = View.of(context) .physicalSize; });  
133135  ///   }  
134136  /// 
135137  ///   @override 
@@ -186,7 +188,7 @@ abstract class WidgetsBindingObserver {
186188  /// 
187189  ///   @override 
188190  ///   void didChangeTextScaleFactor() {  
189-   ///     setState(() { _lastTextScaleFactor = WidgetsBinding.instance.window .textScaleFactor; });  
191+   ///     setState(() { _lastTextScaleFactor = WidgetsBinding.instance.platformDispatcher .textScaleFactor; });  
190192  ///   }  
191193  /// 
192194  ///   @override 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments