Skip to content
pubscout

stretch_wrap

0.1.1, released a year ago by an unverified publisher

A Flutter widget that wraps children into rows and stretches designated items to fill remaining space.

WASM-readyCopyleft license
$ flutter pub add stretch_wrap
Source repository

What it does

The StretchWrap widget behaves like Flutter's built-in Wrap, but allows you to mark specific children with Stretch to fill the remaining space in each row. It supports multiple stretched children with distinct flex ratios, configurable spacing, and alignment options.

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

Use it when

  • You need a wrapping layout where specific items stretch to fill the row's remaining width.
  • You want to build tag lists or responsive button groups with flexible items.

Skip it when

  • You only need standard wrapping behavior without stretching items (use Flutter's built-in Wrap).
  • You are building a rigid two-dimensional grid with fixed column and row counts.

Strengths

  • Supports multiple stretched children per row with proportional flex values.
  • Provides extensive alignment and spacing configuration.
  • Easy to use widget-based API similar to Wrap.

Weaknesses

  • Limited documentation on some advanced properties beyond README descriptions.
  • Platform support documentation is minimal.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
StretchWrap(
  spacing: 8,
  runSpacing: 16,
  children: [
    Container(width: 100, height: 50, color: Colors.red),
    Stretch(
      child: Container(width: 50, height: 50, color: Colors.blue),
    ),
    Container(width: 80, height: 50, color: Colors.green),
  ],
)

Alternatives

Packages that do the same job and could replace stretch_wrap.