BoxConstraints.tightForFinite constructor Null safety

const BoxConstraints.tightForFinite(
  1. {double width = double.infinity,
  2. double height = double.infinity}
)

Creates box constraints that require the given width or height, except if they are infinite.

See also:

  • BoxConstraints.tightFor, which is similar but instead of being tight if the value is not infinite, is tight if the value is non-null.

Implementation

const BoxConstraints.tightForFinite({
  double width = double.infinity,
  double height = double.infinity,
}) : minWidth = width != double.infinity ? width : 0.0,
     maxWidth = width != double.infinity ? width : double.infinity,
     minHeight = height != double.infinity ? height : 0.0,
     maxHeight = height != double.infinity ? height : double.infinity;