boxConstraints static method

BoxConstraints? boxConstraints(
  1. DataSource source,
  2. List<Object> key
)

Decodes the specified map into a BoxConstraints.

The keys used are minWidth, maxWidth, minHeight, and maxHeight. Omitted keys are defaulted to 0.0 for minimums and infinity for maximums.

Implementation

static BoxConstraints? boxConstraints(DataSource source, List<Object> key) {
  if (!source.isMap(key)) {
    return null;
  }
  return BoxConstraints(
    minWidth: source.v<double>([...key, 'minWidth']) ?? 0.0,
    maxWidth: source.v<double>([...key, 'maxWidth']) ?? double.infinity,
    minHeight: source.v<double>([...key, 'minHeight']) ?? 0.0,
    maxHeight: source.v<double>([...key, 'maxHeight']) ?? double.infinity,
  );
}