removePadding method

MediaQueryData removePadding ({bool removeLeft: false, bool removeTop: false, bool removeRight: false, bool removeBottom: false })

Creates a copy of this media query data but with the given paddings replaced with zero.

The removeLeft, removeTop, removeRight, and removeBottom arguments must not be null. If all four are false (the default) then this MediaQueryData is returned unmodified.

See also:

Implementation

MediaQueryData removePadding({
  bool removeLeft = false,
  bool removeTop = false,
  bool removeRight = false,
  bool removeBottom = false,
}) {
  if (!(removeLeft || removeTop || removeRight || removeBottom))
    return this;
  return MediaQueryData(
    size: size,
    devicePixelRatio: devicePixelRatio,
    textScaleFactor: textScaleFactor,
    padding: padding.copyWith(
      left: removeLeft ? 0.0 : null,
      top: removeTop ? 0.0 : null,
      right: removeRight ? 0.0 : null,
      bottom: removeBottom ? 0.0 : null,
    ),
    viewInsets: viewInsets,
    alwaysUse24HourFormat: alwaysUse24HourFormat,
    disableAnimations: disableAnimations,
    invertColors: invertColors,
    accessibleNavigation: accessibleNavigation,
    boldText: boldText,
  );
}