ShapeSized constructor

ShapeSized({
  1. required ShapePart child,
  2. double? extent,
  3. double flex = 1,
  4. ShapeVisibility? visibleWhen,
  5. String? textHeightSlot,
  6. String? contentHeightSlot,
})

Implementation

ShapeSized({
  required this.child,
  this.extent,
  this.flex = 1,
  this.visibleWhen,
  this.textHeightSlot,
  this.contentHeightSlot,
}) {
  if (extent != null && (!extent!.isFinite || extent! <= 0) ||
      !flex.isFinite ||
      flex <= 0 ||
      (visibleWhen?.key.trim().isEmpty ?? false) ||
      (textHeightSlot?.trim().isEmpty ?? false) ||
      (textHeightSlot != null && extent != null) ||
      (contentHeightSlot?.trim().isEmpty ?? false) ||
      (contentHeightSlot != null &&
          (extent != null || textHeightSlot != null))) {
    throw ArgumentError('Extent and flex must be finite and positive');
  }
}