validate method

  1. @override
void validate(
  1. ShapeRegistry shapes
)
override

Implementation

@override
void validate(ShapeRegistry shapes) {
  final shape = shapes.require(shapeType);
  if (editAfterCreation && !shape.textEditable) {
    throw ArgumentError('Tool cannot edit text in $shapeType.');
  }
  if (autoWidthOnClick &&
      shape.behavior.textSizing == ShapeTextSizing.fixed) {
    throw ArgumentError('Tool cannot auto-size text in $shapeType.');
  }
}