UnconstrainedBox

This widget motivated by UnconstrainedBox in Flutter.

A widget that imposes no constraints on its child, allowing it to render at its “natural” size.

This allows a child to render at the size it would render if it were alone on an infinite canvas with no constraints. This container will then attempt to adopt the same size, within the limits of its own constraints. If it ends up with a different size, it will align the child based on alignment. If the box cannot expand enough to accommodate the entire child, the child will be clipped.

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

Props

constrainedAxis

Value: vertical | horizontal | undefined

alignment

Value: Alignment (default: Alignment.center)

clipped

Value: boolean (default: false)

child

Value: Widget | undefined

Examples

Basic