paintBounds property
Rect?
paintBounds
获取组件在屏幕中的坐标
Implementation
Rect? get paintBounds {
final renderObject = findRenderObject();
final translation = renderObject?.getTransformTo(null).getTranslation();
if (translation != null && renderObject?.paintBounds != null) {
final offset = Offset(translation.x, translation.y);
return renderObject!.paintBounds.shift(offset);
} else {
return null;
}
}