lowerBounded method

ViewPort lowerBounded(
  1. ViewPort decorated, {
  2. double height = 0,
  3. double width = 0,
})

Provides a ViewPort which ViewPort.width and ViewPort.height values will be lower bounded by the given ones.

Simply said, if the decorated values are lesser than the defined bounds, then bound values are returned (e.g. decorated.width = 500 and width = 600, then 600 will be returned).

width describes the width's lower bound, height - height's lower bound. The values are 0 by default (so if both values were not specified then the resulting object will produce the decorated instance behavior).

final ViewPort vp = const ViewPorts().lowerBounded(
  const ViewPorts().fromMediaQueryData(MediaQuery.of(context)),
  width: 200.0,
);

Implementation

ViewPort lowerBounded(
  ViewPort decorated, {
  double height = 0,
  double width = 0,
}) =>
    maxOf(decorated, fixed(height: height, width: width));