measure_size
5.0.2, released 11 months ago by qrl.app
Widget that reports its size changes via a callback.
What it does
Provides a MeasureSize widget that calls a callback with the rendered size of its child. MeasureSizeBuilder can measure multiple prototypes in a single layout pass.
AI-written summary of version 5.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to react to a widget's size after it is rendered
- Building adaptive layouts that depend on actual widget dimensions
Skip it when
- You require size information before the first layout pass
- You need to measure PreferredSizeWidget reliably
Strengths
- Low overhead size detection
- Simple API with just a child and onChange callback
- MeasureSizeBuilder can handle multiple widgets efficiently
Weaknesses
- Does not work with PreferredSizeWidget on the first frame
- Only provides size after layout, not during build
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:measure_size/measure_size.dart';
Widget child = Text('Lorem ipsum');
MeasureSize(
onChange: (Size newSize) {
// newSize is the displayed size of child
},
child: child,
);Alternatives
Packages that do the same job and could replace measure_size.
- flutter_scrolling_fab_animated
A floating action button that animates its size when scrolling down.
50Compare - pinch_zoom
Widget that adds pinch‑to‑zoom with automatic reset on release for images or video.
60Compare - lazy_load_scrollview
A wrapper for scrollable widgets that triggers a callback when reaching the end of the page.
50Compare - swipe_to
A Flutter wrapper widget to add horizontal swipe callbacks for chat views.
50Compare
Works with
Packages commonly used together with measure_size: ones it builds on, ones built on it, and its own family.