SizedBox constructor

SizedBox({
  1. num? width,
  2. num? height,
  3. BloomNode? child,
})

Creates a box with optional explicit dimensions.

SizedBox(width: 120, child: StyledText('Wide'));

Implementation

SizedBox({num? width, num? height, BloomNode? child})
    : super('div',
          children: child == null ? const [] : [child],
          style: _css([
            if (width != null) 'width: ${_px(width)}',
            if (height != null) 'height: ${_px(height)}',
          ]));