toImage method
Implementation
Future<Image> toImage({double pixelRatio = 1.0}) {
assert(layer != null);
assert(isRepaintBoundary);
final OffsetLayer offsetLayer = layer as OffsetLayer;
return offsetLayer.toImage(Offset.zero & size, pixelRatio: pixelRatio);
}