copyWith method Null safety
- {Size? size,
- double? devicePixelRatio,
- double? textScaleFactor,
- Brightness? platformBrightness,
- EdgeInsets? padding,
- EdgeInsets? viewPadding,
- EdgeInsets? viewInsets,
- EdgeInsets? systemGestureInsets,
- bool? alwaysUse24HourFormat,
- bool? highContrast,
- bool? disableAnimations,
- bool? invertColors,
- bool? boldText,
- DeviceGestureSettings? gestureSettings,
- List<
DisplayFeature> ? displayFeatures}
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,
bool? alwaysUse24HourFormat,
bool? highContrast,
bool? disableAnimations,
bool? invertColors,
bool? accessibleNavigation,
bool? boldText,
NavigationMode? navigationMode,
DeviceGestureSettings? gestureSettings,
List<ui.DisplayFeature>? displayFeatures,
}) {
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,
alwaysUse24HourFormat: alwaysUse24HourFormat ?? this.alwaysUse24HourFormat,
invertColors: invertColors ?? this.invertColors,
highContrast: highContrast ?? this.highContrast,
disableAnimations: disableAnimations ?? this.disableAnimations,
accessibleNavigation: accessibleNavigation ?? this.accessibleNavigation,
boldText: boldText ?? this.boldText,
navigationMode: navigationMode ?? this.navigationMode,
gestureSettings: gestureSettings ?? this.gestureSettings,
displayFeatures: displayFeatures ?? this.displayFeatures,
);
}