sized method

Widget sized({
  1. SizeUnit? width,
  2. SizeUnit? height,
  3. Key? key,
})

Sets both width and height dimensions simultaneously.

This is a convenience method that allows setting both dimensions in a single call. Either or both dimensions can be specified.

Example:

Container().sized(
  width: 100.size,
  height: 50.size,
),
Container().sized(width: 200.size),  // Only width

Implementation

Widget sized({
  SizeUnit? width,
  SizeUnit? height,
  Key? key,
}) {
  return _WidgetWrapper._wrapOrCopyWith(
    child: this,
    key: key != null ? () => key : null,
    width: width != null ? () => width : null,
    height: height != null ? () => height : null,
  );
}