MediaQuery constructor Null safety

const MediaQuery(
  1. {Key? key,
  2. required MediaQueryData data,
  3. required Widget child}
)

Creates a widget that provides MediaQueryData to its descendants.

The data and child arguments must not be null.

Implementation

const MediaQuery({
  Key? key,
  required this.data,
  required Widget child,
}) : assert(child != null),
     assert(data != null),
     super(key: key, child: child);