rect property

Rect rect
inherited

Returns the global rectangle of the attached widget's RenderObject, in logical units.

Implementation

Rect get rect {
  assert(
      context != null,
      "Tried to get the bounds of a focus node that didn't have its context set yet.\n"
      'The context needs to be set before trying to evaluate traversal policies. This '
      'is typically done with the attach method.');
  final RenderObject object = context.findRenderObject();
  final Offset globalOffset = MatrixUtils.transformPoint(object.getTransformTo(null), object.semanticBounds.topLeft);
  return globalOffset & object.semanticBounds.size;
}