clearShapes method
Removes every shape, or only those of pageIndex.
Implementation
void clearShapes({int? pageIndex}) {
if (!_shapes.any((UDocShape shape) => pageIndex == null || shape.pageIndex == pageIndex)) return;
_checkpoint();
_shapes.removeWhere((UDocShape shape) => pageIndex == null || shape.pageIndex == pageIndex);
_commit();
}