prototype_constrained_box
2.0.6, released 8 weeks ago by mateusfccp.me
A ConstrainedBox widget where constraints are determined by another prototype widget.
What it does
PrototypeConstrainedBox behaves like a standard ConstrainedBox, but instead of taking explicit BoxConstraints, it takes another widget to act as the prototype for sizing constraints. You can constrain the child loosely or tightly in one or both axes based on the prototype.
AI-written summary of version 2.0.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a widget to match the size or constraints of another prototype widget.
- You want to constrain a child widget tightly or loosely based on dynamic content sizing.
Skip it when
- You already have explicit BoxConstraints and can simply use a standard ConstrainedBox.
Strengths
- Simplifies sizing elements based on a prototype widget.
- Provides convenient constructors like tight, loose, and tightFor.
Weaknesses
- Adds widget tree complexity compared to native sizing or basic constraints.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
const PrototypeConstrainedBox.tight(
prototype: Text('Lorem ipsum dolor'),
child: ColoredBox(
color: Color(0xFFFF0000),
),
);Alternatives
Packages that do the same job and could replace prototype_constrained_box.
- material_segmented_control
Material style segmented control widget for Flutter.
50Compare - salomon_bottom_bar
A customizable bottom navigation bar matching Aurélien Salomon's design specification.
50Compare - progress_border
A BoxBorder that draws part of a border based on progress.
50Compare - prompt_dialog
A JavaScript-like prompt dialog widget for Flutter applications.
50Compare