AspectRatio

This widget motivated by AspectRatio in Flutter.

A widget that attempts to size the child to a specific aspect ratio.

The widget first tries the largest width permitted by the layout constraints. The height of the widget is determined by applying the given aspect ratio to the width, expressed as a ratio of width to height.

See: https://api.flutter.dev/flutter/widgets/AspectRatio-class.html

Props

aspectRatio

Value: number

child

Value: Widget | undefined

Examples

Basic