Repaint the given render object.
The render object must have a composited layer and must be in need of painting. The render object's layer is re-used, along with any layers in the subtree that don't need to be repainted.
Source
static void repaintCompositedChild(RenderObject child, { bool debugAlsoPaintedParent: false }) {
assert(child.isRepaintBoundary);
assert(child._needsPaint);
assert(() {
child.debugRegisterRepaintBoundaryPaint(includedParent: debugAlsoPaintedParent, includedChild: true);
return true;
});
child._layer ??= new OffsetLayer();
child._layer.removeAllChildren();
assert(() {
child._layer.debugCreator = child.debugCreator ?? child.runtimeType;
return true;
});
PaintingContext childContext = new PaintingContext._(child._layer, child.paintBounds);
child._paintWithContext(childContext, Offset.zero);
childContext._stopRecordingIfNeeded();
}