Aspect Ratio
Use aspect ratio utilities to set a fixed width-to-height ratio on an element. Useful for media containers, cards, and placeholder areas.
Style('aspect-3/2 object-cover ...', child: Image.network('/img/villas.jpg'))Class reference
Section titled “Class reference”| Class | Description |
|---|---|
aspect-auto | Use the element’s natural aspect ratio |
aspect-square | Force a 1:1 aspect ratio |
aspect-video | Force a 16:9 aspect ratio |
aspect-[4/3] | Arbitrary aspect ratio using bracket notation |