copyWith method

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

Creates a copy of this media query data but with the given fields replaced with the new values.

Implementation

MediaQueryData copyWith({
  Size size,
  double devicePixelRatio,
  double textScaleFactor,
  Brightness platformBrightness,
  EdgeInsets padding,
  EdgeInsets viewPadding,
  EdgeInsets viewInsets,
  EdgeInsets systemGestureInsets,
  double physicalDepth,
  bool alwaysUse24HourFormat,
  bool highContrast,
  bool disableAnimations,
  bool invertColors,
  bool accessibleNavigation,
  bool boldText,
}) {
  return MediaQueryData(
    size: size ?? this.size,
    devicePixelRatio: devicePixelRatio ?? this.devicePixelRatio,
    textScaleFactor: textScaleFactor ?? this.textScaleFactor,
    platformBrightness: platformBrightness ?? this.platformBrightness,
    padding: padding ?? this.padding,
    viewPadding: viewPadding ?? this.viewPadding,
    viewInsets: viewInsets ?? this.viewInsets,
    systemGestureInsets: systemGestureInsets ?? this.systemGestureInsets,
    physicalDepth: physicalDepth ?? this.physicalDepth,
    alwaysUse24HourFormat: alwaysUse24HourFormat ?? this.alwaysUse24HourFormat,
    invertColors: invertColors ?? this.invertColors,
    highContrast: highContrast ?? this.highContrast,
    disableAnimations: disableAnimations ?? this.disableAnimations,
    accessibleNavigation: accessibleNavigation ?? this.accessibleNavigation,
    boldText: boldText ?? this.boldText,
  );
}