MediaQueryData constructor

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. double physicalDepth: double.maxFinite,
  10. bool alwaysUse24HourFormat: false,
  11. bool accessibleNavigation: false,
  12. bool invertColors: false,
  13. bool highContrast: false,
  14. bool disableAnimations: false,
  15. bool boldText: false}
)

Creates data for a media query with explicit values.

Consider using MediaQueryData.fromWindow to create data based on a Window.

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.physicalDepth = double.maxFinite,
  this.alwaysUse24HourFormat = false,
  this.accessibleNavigation = false,
  this.invertColors = false,
  this.highContrast = false,
  this.disableAnimations = false,
  this.boldText = false,
}) : 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(physicalDepth != null),
     assert(alwaysUse24HourFormat != null),
     assert(accessibleNavigation != null),
     assert(invertColors != null),
     assert(highContrast != null),
     assert(disableAnimations != null),
     assert(boldText != null);