Skip to content
pubscout

rect_getter

1.1.0, released 5 years ago by debuggerx.com

A widget that provides a simple way to get a child widget's rectangle information after rendering.

WASM-ready
$ flutter pub add rect_getter
Source repository

What it does

The rect_getter package provides a wrapper widget that allows developers to easily retrieve the size and position (Rect) of its child widget after the layout has been rendered. It supports fetching the rectangle using either a custom global key or a default key provided by the widget.

AI-written summary of version 1.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to get the exact position or size of a widget after it has been rendered on screen.
  • You are implementing custom tooltips, overlays, or animations that require the target widget's bounding box.

Skip it when

  • You can accomplish the layout requirement using standard layout builders or constraints without needing absolute coordinates.
  • You need complex gesture detection or animations covered by existing specialized widgets.

Strengths

  • Simple and straightforward API for getting rendered widget bounds.
  • Supports both custom global keys and default keys.

Weaknesses

  • Limited to getting rectangle information after rendering.
  • Minimal documentation and features beyond basic rect retrieval.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Not documented

import 'package:rect_getter/rect_getter.dart';

var globalKey = RectGetter.createGlobalKey();
var rectGetter = RectGetter(
    key: globalKey,
    child: _child,
);

Rect rect = rectGetter.getRect();

Alternatives

Packages that do the same job and could replace rect_getter.

Works with

Packages commonly used together with rect_getter: ones it builds on, ones built on it, and its own family.