ShapeSurfaceLayerDefinition constructor

ShapeSurfaceLayerDefinition({
  1. required String id,
  2. required ShapeBoundsDefinition bounds,
  3. required ShapeOutline? outline,
  4. required ShapeStyle style,
  5. ShapeVisibility? visibleWhen,
  6. String? onInteract,
})

Implementation

ShapeSurfaceLayerDefinition({
  required super.id,
  required super.bounds,
  required this.outline,
  required this.style,
  this.visibleWhen,
  this.onInteract,
}) {
  if (!style.isValid ||
      (outline?.isInk ?? false) ||
      (onInteract?.trim().isEmpty ?? false)) {
    throw ArgumentError(
      'A surface requires a valid style and a contour, not ink',
    );
  }
}