validateText method

void validateText()

Validates that the node supports text capabilities and throws a descriptive error if it doesn't.

Implementation

void validateText() {
  if (!supportsText) {
    throw ArgumentError(
      'Node of type ${node.runtimeType} does not support text capabilities. '
      'The node must be a Text node.',
    );
  }
}