Skip to content

Aspect Ratio

A component that maintains a specific aspect ratio for its child content.

The RatioBox widget ensures consistent proportional dimensions regardless of screen size. This is particularly useful for media content, cards, and responsive layouts.

  • Responsive: Maintains proportions across screen sizes
  • Customizable: Supports any ratio value and border radius
  • Flexible: Works with any child widget
  • Clipping: Supports custom clipping behavior

Perfect for profile pictures, album covers, or square content.


Common in photography, particularly for DSLR cameras.


Traditional display format, common for slides and older media.


Common in photography and print formats.


Common format for videos, modern displays, and presentations.


Standard for portrait photography and many printed materials.


Vertical orientation of the classic 4:3 format.


Common for vertical photos and UI elements.


Ideal for mobile-oriented content and vertical videos.


Using rounded corners with the aspect ratio container.


PropertyTypeDescription
ratiodoubleThe aspect ratio to enforce (width / height)
childWidgetThe widget to size according to the specified aspect ratio
clipBehaviorClipHow to clip the child content
borderRadiusBorderRadiusGeometry?The border radius to apply to the widget