MediaQueryData constructor Null safety

const MediaQueryData(
  1. {Size size,
  2. double devicePixelRatio,
  3. double textScaleFactor,
  4. Brightness platformBrightness,
  5. EdgeInsets padding,
  6. EdgeInsets viewInsets,
  7. EdgeInsets systemGestureInsets,
  8. EdgeInsets viewPadding,
  9. bool alwaysUse24HourFormat,
  10. bool accessibleNavigation,
  11. bool invertColors,
  12. bool highContrast,
  13. bool disableAnimations,
  14. bool boldText,
  15. NavigationMode navigationMode}
)

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,
}) : 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);