fromWindow static method

  1. @Deprecated('Use MediaQuery.fromView instead. ' 'This constructor was deprecated in preparation for the upcoming multi-window support. ' 'This feature was deprecated after v3.7.0-32.0.pre.')
Widget fromWindow(
  1. {Key? key,
  2. required Widget child}
)

Deprecated. Use MediaQuery.fromView instead.

This constructor was operating on a single window assumption. In preparation for Flutter's upcoming multi-window support, it has been deprecated.

Replaced by MediaQuery.fromView, which requires specifying the FlutterView the MediaQuery is constructed for. The FlutterView can, for example, be obtained from the context via View.of or from PlatformDispatcher.views.

Implementation

@Deprecated(
  'Use MediaQuery.fromView instead. '
  'This constructor was deprecated in preparation for the upcoming multi-window support. '
  'This feature was deprecated after v3.7.0-32.0.pre.'
)
static Widget fromWindow({
  Key? key,
  required Widget child,
}) {
  return _MediaQueryFromView(
    key: key,
    view: WidgetsBinding.instance.window,
    ignoreParentData: true,
    child: child,
  );
}