deselectObjectDrawable method

void deselectObjectDrawable({
  1. bool isRemoved = false,
})

Deselects the object drawable from the drawables.

isRemoved is whether the deselection happened because the selected object drawable was deleted. If so, the controller will send a SelectedObjectDrawableRemovedEvent to listening widgets.

If selectedObjectDrawable is already null, nothing happens and notifyListeners is not called.

Calling this will notify all the listeners of this PainterController that they need to update (it calls notifyListeners). For this reason, this method should only be called between frames, e.g. in response to user actions, not during the build, layout, or paint phases.

Implementation

void deselectObjectDrawable({bool isRemoved = false}) {
  if (selectedObjectDrawable != null && isRemoved) {
    _eventsSteamController.add(const SelectedObjectDrawableRemovedEvent());
  }
  selectObjectDrawable(null);
}