upperBoundedMediaQuery method

ViewPort upperBoundedMediaQuery(
  1. MediaQueryData data, {
  2. double height = double.infinity,
  3. double width = double.infinity,
})

Provides a ViewPort which will produce the data's size values that are upper bounded by the given height and width

Simply said, if the data size values are bigger than the defined bounds, then bound values are returned (e.g. data.size.width = 500 and width = 400, then 400 will be returned).

width describes the width's upper bound, height - height's upper bound. The values are set to double.infinity by default (so if both values were not specified then the resulting object will produce the data's size instance behavior).

final ViewPort vp = const ViewPorts().upperBoundedMediaQuery(
  MediaQuery.of(context),
  width: 1024.0,
);

Implementation

ViewPort upperBoundedMediaQuery(
  MediaQueryData data, {
  double height = double.infinity,
  double width = double.infinity,
}) =>
    upperBounded(fromMediaQueryData(data), height: height, width: width);