removeViewPadding method

MediaQueryData removeViewPadding(
  1. {bool removeLeft = false,
  2. bool removeTop = false,
  3. bool removeRight = false,
  4. bool removeBottom = false}
)

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

If all four of the removeLeft, removeTop, removeRight, and removeBottom arguments are false (the default), then this MediaQueryData is returned unmodified.

See also:

Implementation

MediaQueryData removeViewPadding({
  bool removeLeft = false,
  bool removeTop = false,
  bool removeRight = false,
  bool removeBottom = false,
}) {
  if (!(removeLeft || removeTop || removeRight || removeBottom)) {
    return this;
  }
  return copyWith(
    padding: padding.copyWith(
      left: removeLeft ? 0.0 : null,
      top: removeTop ? 0.0 : null,
      right: removeRight ? 0.0 : null,
      bottom: removeBottom ? 0.0 : null,
    ),
    viewPadding: viewPadding.copyWith(
      left: removeLeft ? 0.0 : null,
      top: removeTop ? 0.0 : null,
      right: removeRight ? 0.0 : null,
      bottom: removeBottom ? 0.0 : null,
    ),
  );
}