AspectRatio
Sizes its child to a target width:height ratio while staying within the parent’s constraints. When bounded constraints admit the ratio, the largest matching box wins. An unbounded axis falls back to its minimum, and incompatible minimums can force the result away from the target ratio.
Learn more: Layout
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
AspectRatio( aspectRatio: 2.0, child: Heatmap(values: values),)Details
Section titled “Details”⚠ Terminal cells are typically taller than wide (often roughly
2:1 height:width). A literal 1:1 aspectRatio produces a visually
rectangular box. For visually square content (e.g. heatmap cells)
multiply by the cell height-to-width ratio:
AspectRatio(aspectRatio: 2.0, ...) for a typical 2:1 cell, or use your
terminal’s measured cell aspect.
Constructors
Section titled “Constructors”AspectRatio()
Section titled “AspectRatio()”| Parameter | Type | Default | Description |
|---|---|---|---|
aspectRatio: | double | required | Target ratio expressed as width / height in cells. A ratio of 2.0 means the box is twice as wide as it is tall. |
child: | Widget | required | Content laid out within the resolved box. |
Source
Section titled “Source”AspectRatio is defined in packages/fleury/lib/src/widgets/basic.dart.
Category: Layout · All widgets