isEmpty property

bool isEmpty

Implementation

bool get isEmpty {
  if (root.children.isEmpty) {
    return true;
  }

  if (root.children.length > 1) {
    return false;
  }

  final node = root.children.first;
  if (node is TextNodeV0 &&
      (node.delta.isEmpty || node.delta.toPlainText().isEmpty)) {
    return true;
  }

  return false;
}