Skip to content
pubscout

wrapfit

0.1.1, released 3 years ago by an unverified publisher

A new way to fit children of Wrap using Wrap2 and Wrapped widgets.

WASM-ready
$ flutter pub add wrapfit
Source repository

What it does

The package provides a new way to fit children of a Wrap widget. It allows developers to stretch a child of Wrap2 to fill the remaining space of the current run using different WrapFit 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 to stretch children of a Wrap widget to fill remaining run space
  • You want to use features from Flutter PR #136161 before they land in stable Flutter

Skip it when

  • The WrapFit feature becomes natively available in the stable Flutter release
  • You are concerned about packages that might be archived if an upstream PR is not merged

Strengths

  • Allows fine-grained control over wrapping behavior with runTight, runLoose, tight, and loose fits
  • Simple migration path to stable Flutter implementation when available

Weaknesses

  • May be archived once the feature is available in stable Flutter or if the upstream PR does not get merged
  • Relies on a non-standard Wrap2 and Wrapped replacement rather than enhancing the core Flutter Wrap

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Add the package to dependencies and replace Wrap with Wrap2.

Wrap2(
    children: [
        Text("Default (loose)"),
        Wrapped(
            fit: WrapFit.runTight,
            child: Text("runTight"),
        ),
    ]
)

Alternatives

Packages that do the same job and could replace wrapfit.

  • stretch_wrap

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

  • invert_colors

    A lightweight widget that inverts the colors of its children.