Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prototype_constrained_box

Version License

Features

  • Just like ConstrainedBox, you can constrain the child of this widget;
  • However, instead of passing directly a BoxConstraints, you pass another prototype widget that will be used as constraint;
  • You may constrain the child loosely or tightly, in one or both of the axes.

Usage

Use the PrototypeConstrainedBox widget by providing a prototype and a child.

The following example will render a ColoredBox that will fill the space that the given prototype text would occupy:

const PrototypeConstrainedBox.tight(
  prototype: Text('Lorem ipsum dolor'),
  child: ColoredBox(
    color: Color(0xFFFF0000),
  ),
);

Aside from .tight, PrototypeConstrainedBox also provides .loose, .tightFor or you can completely customize the constraints by using the default unnamed constructor.

For more information regarding the PrototypeConstrainedBox API, refer to the documentation.

About

A ConstrainedBox-like widget, but the constraints are given by another widget.

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages