MediaQueryData constructor Null safety

const MediaQueryData(
  1. {Size size = Size.zero,
  2. double devicePixelRatio = 1.0,
  3. double textScaleFactor = 1.0,
  4. Brightness platformBrightness = Brightness.light,
  5. EdgeInsets padding = EdgeInsets.zero,
  6. EdgeInsets viewInsets = EdgeInsets.zero,
  7. EdgeInsets systemGestureInsets = EdgeInsets.zero,
  8. EdgeInsets viewPadding = EdgeInsets.zero,
  9. bool alwaysUse24HourFormat = false,
  10. bool accessibleNavigation = false,
  11. bool invertColors = false,
  12. bool highContrast = false,
  13. bool disableAnimations = false,
  14. bool boldText = false,
  15. NavigationMode navigationMode = NavigationMode.traditional,
  16. DeviceGestureSettings gestureSettings = const DeviceGestureSettings(touchSlop: kTouchSlop),
  17. List<DisplayFeature> displayFeatures = const <ui.DisplayFeature>[]}
)

Creates data for a media query with explicit values.

Consider using MediaQueryData.fromWindow to create data based on a dart:ui.PlatformDispatcher.

Implementation

const MediaQueryData({
  this.size = Size.zero,
  this.devicePixelRatio = 1.0,
  this.textScaleFactor = 1.0,
  this.platformBrightness = Brightness.light,
  this.padding = EdgeInsets.zero,
  this.viewInsets = EdgeInsets.zero,
  this.systemGestureInsets = EdgeInsets.zero,
  this.viewPadding = EdgeInsets.zero,
  this.alwaysUse24HourFormat = false,
  this.accessibleNavigation = false,
  this.invertColors = false,
  this.highContrast = false,
  this.disableAnimations = false,
  this.boldText = false,
  this.navigationMode = NavigationMode.traditional,
  this.gestureSettings = const DeviceGestureSettings(touchSlop: kTouchSlop),
  this.displayFeatures = const <ui.DisplayFeature>[],
}) : assert(size != null),
     assert(devicePixelRatio != null),
     assert(textScaleFactor != null),
     assert(platformBrightness != null),
     assert(padding != null),
     assert(viewInsets != null),
     assert(systemGestureInsets != null),
     assert(viewPadding != null),
     assert(alwaysUse24HourFormat != null),
     assert(accessibleNavigation != null),
     assert(invertColors != null),
     assert(highContrast != null),
     assert(disableAnimations != null),
     assert(boldText != null),
     assert(navigationMode != null),
     assert(gestureSettings != null),
     assert(displayFeatures != null);