from static method
Implementation
static XBoxParams? from(
XBox widget,
SSRBuildContext context,
WidgetMetadata metadata,
) {
final child = _cookWidget(widget.child, context);
if (metadata.vanish && child == null) {
return null;
}
return XBoxParams(
child: child,
width: widget.width.toExtent(isDimension: true),
height: widget.height.toExtent(isDimension: true),
padding: widget.padding?.toEdgeInsets(),
margin: widget.margin?.toEdgeInsets(),
backgroundImage:
XAssetParams.fromNullable(widget.backgroundImage, context),
radius: widget.radius?.toBorderRadius(),
color: widget.color.toHubbleColor(),
border: widget.border?.toHubbleBorder(),
shadow: widget.shadow.map((e) => e.toHubbleBoxShadow()).toList(),
gradient: widget.gradientV2?.toHubbleGradient() ??
widget.gradient?.toHubbleLinearGradient(),
clip: widget.clipBehavior?.toClip() ?? Clip.none,
alignment: widget.hasAlignmentV2()
? widget.alignmentV2?.toAlignment()
: widget.alignment?.toAlignment(),
);
}