BoxConstraints.tightFor constructor

BoxConstraints.tightFor({
  1. double? width,
  2. double? height,
})

Tight on the axes that are specified (same idea as Flutter / package:pdf).

Implementation

factory BoxConstraints.tightFor({double? width, double? height}) {
  return BoxConstraints(
    minWidth: width ?? 0,
    maxWidth: width ?? double.infinity,
    minHeight: height ?? 0,
    maxHeight: height ?? double.infinity,
  );
}