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.
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.
- info_popup
A customizable tooltip and popup overlay widget with optional target highlighting.
59Compare - pinch_zoom_release_unzoom
A widget that provides Instagram-like pinch-to-zoom that resets size when released.
59Compare - measure_size_builder
A widget that measures the rendering size of its child dynamically.
44Compare - flutter_sensitive_content
Hides sensitive content when switching away from the app.
45Compare
Works with
Packages commonly used together with rect_getter: ones it builds on, ones built on it, and its own family.