layer property
The compositing layer that this render object uses to repaint.
Call only when isRepaintBoundary is true and the render object has already painted.
To access the layer in debug code, even when it might be inappropriate to access it (e.g. because it is dirty), consider debugLayer.
Implementation
OffsetLayer get layer {
assert(isRepaintBoundary, 'You can only access RenderObject.layer for render objects that are repaint boundaries.');
assert(!_needsPaint);
return _layer;
}