Skip to main content

FittedBox

Stac FittedBox allows you to build the Flutter FittedBox widget using JSON. To know more about the FittedBox widget in Flutter, refer to the official documentation.


Properties​

PropertyTypeDescription
fitBoxFitDefines how the child should be fitted within the box. Defaults to BoxFit.contain.
alignmentStacAlignmentDirectionalAligns the child within the box. Defaults to StacAlignmentDirectional.center.
clipBehaviorClipSpecifies whether and how the content should be clipped. Defaults to Clip.none.
childMap<String, dynamic>?The child widget, represented as a JSON object, to be positioned and scaled.

Example JSON​

{
"type": "fittedBox",
"fit": "contain",
"alignment": "center",
"child": {
"type": "text",
"data": "Hello, World!",
"style": {
"fontSize": 20,
"color": "#000000"
}
}
}