detach method

  1. @override
void detach ()

Mark this node as detached.

Typically called only from the parent's detach, and by the owner to mark the root of a tree as detached.

Subclasses with children should override this method to first call their inherited detach method, and then detach all their children.


void detach() {
  _painter = null;
  // Since we're disposing of our painter, we won't receive change
  // notifications. We mark ourselves as needing paint so that we will
  // resubscribe to change notifications. If we didn't do this, then, for
  // example, animated GIFs would stop animating when a DecoratedBox gets
  // moved around the tree due to GlobalKey reparenting.