wrapfit 0.1.1 copy "wrapfit: ^0.1.1" to clipboard
wrapfit: ^0.1.1 copied to clipboard

A new way to fit children of Wrap.

WrapFit, proposed in PR #136161, is a new way to fit children of Wrap. Since it's not clear when and if this PR is merged, I've created this package for those developers who need the feature right now.

Disclaimer #

As soon, as WrapFit is available in the stable flutter release, I'll archive this package and publish a new version that @deprecates all the features. Upgrading to the flutter implementation should be as simple as changing Wrap2 to Wrap.

In case the PR doesn't get merged, I might archive this package without an adequate alternative.

Features #

Mainly, this package allows developers to stretch a child of Wrap2 to fill the remaining space of the current run.

Demonstration of WrapFit.runLoose

Getting started #

  1. Add the package to the dependencies: flutter pub add wrapfit
  2. Use Wrap2 instead of Wrap
  3. Wrap a child of Wrap2 with Wrapped and set fit.
    • WrapFit.runTight
    • WrapFit.runLoose
    • WrapFit.tight
    • WrapFit.loose

Usage #

(Also have a look at the full app example.)

Wrap2(
    children: [
        Text("Default (loose)"),
        Wrapped(
            fit: WrapFit.runTight,
            child: Text("runTight"),
        ),
        Wrapped(
            fit: WrapFit.runLoose,
            child: Text("runLoose"),
        ),
        Wrapped(
            fit: WrapFit.tight,
            child: Text("tight"),
        ),
        Wrapped(
            fit: WrapFit.loose,
            child: Text("loose"),
        ),
    ]
)
8
likes
150
points
1k
downloads

Publisher

unverified uploader

Weekly Downloads

A new way to fit children of Wrap.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on wrapfit