isContainerEmpty function

bool isContainerEmpty(
  1. InlineContainerNode container
)

Returns true if container has no children or a single empty Fragment.

Implementation

bool isContainerEmpty(InlineContainerNode container) {
  final children = container.getChildren();
  return children.isEmpty ||
      (children.length == 1 &&
       children.first is Fragment &&
       (children.first as Fragment).text.isEmpty);
}