of static method

Implementation

static MediaQueryData of(BuildContext context) {
  final widget = context.dependOnInheritedWidgetOfExactType<MediaQuery>();
  if (widget == null) {
    throw StateError('MediaQuery.of() called with no MediaQuery ancestor.');
  }
  return widget.data;
}