addDrawables method

void addDrawables(
  1. Iterable<Drawable> drawables, {
  2. bool newAction = true,
})

Add the drawables to the controller value drawables.

If newAction is true, the action is added as an independent action and can be undone in the future. If it is false, the action is connected to the previous action and is merged with it.

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 addDrawables(Iterable<Drawable> drawables, {bool newAction = true}) {
  final action = AddDrawablesAction(drawables.toList());
  action.perform(this);
  _addAction(action, newAction);
}