Skip to content
pubscout

measure_size_builder

1.0.3, released 3 years ago by an unverified publisher

A widget that measures the rendering size of its child dynamically.

WASM-ready
$ flutter pub add measure_size_builder
Source repository

What it does

MeasureSizeBuilder wraps a child widget and provides its dynamically computed size through a builder function. It detects when the widget size changes and can return updated size values in real time based on a configurable sensitivity duration.

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

Use it when

  • You need to access the dynamic width or height of a widget at runtime
  • You want to conditionally alter UI layout or styling based on a widget's measured size

Skip it when

  • You only need standard layout constraints without explicitly reading pixel dimensions

Strengths

  • Easy to use with a builder pattern
  • Detects changed size dynamically when child widgets change
  • Configurable sensitivity duration to control update frequency

Weaknesses

  • Frequent size changes and short sensitivity durations can trigger excessive widget re-renders

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
MeasureSizeBuilder(
  builder: (context, size) {
    return Container(
      color: size.height > 300 ? Colors.red : Colors.blue,
      child: SomeWidget(),
    );
  },
)

Alternatives

Packages that do the same job and could replace measure_size_builder.

  • fdottedline

    Create dotted lines, dashed shapes, and dotted borders for widgets.

  • pinch_zoom_release_unzoom

    A widget that provides Instagram-like pinch-to-zoom that resets size when released.

  • rect_getter

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

  • flutter_gutter

    Provides consistent, screen-size responsive gaps and margins between widgets based on Material breakpoints.