toggleDrawing method

void toggleDrawing([
  1. bool? open
])

Opens or closes the drawing toolbar.

Implementation

void toggleDrawing([bool? open]) {
  final bool next = open ?? !_drawOpen;
  if (next && _toolsOpen) {
    _toolsOpen = false;
    editor?.setTool(UPdfTool.select);
  }
  if (next && !_draw.isActive) _draw.tool = UDocDrawTool.pen;
  if (!next) _draw.tool = UDocDrawTool.none;
  _clearSelection();
  applyState(() {
    _drawOpen = next;
    _activeMarkup = null;
  });
}