Skip to content

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'))
ClassDescription
aspect-autoUse the element’s natural aspect ratio
aspect-squareForce a 1:1 aspect ratio
aspect-videoForce a 16:9 aspect ratio
aspect-[4/3]Arbitrary aspect ratio using bracket notation