Skip to main content

Stack

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

Properties​

PropertyTypeDescription
alignmentStacAlignmentDirectionalHow to align the non-positioned and partially-positioned children. Defaults to StacAlignmentDirectional.topStart.
clipBehaviorClipHow to clip the content. Defaults to Clip.hardEdge.
fitStackFitHow to size the non-positioned children. Defaults to StackFit.loose.
textDirectionTextDirection?The text direction to use for resolving alignment.
childrenList<Map<String, dynamic>>The list of widgets to display inside the stack. Defaults to an empty list.

Example JSON​

{
"type": "stack",
"alignment": "center",
"clipBehavior": "antiAlias",
"fit": "expand",
"textDirection": "ltr",
"children": [
{
"type": "text",
"data": "Hello, World!"
},
{
"type": "container",
"width": 100,
"height": 100,
"color": "#FF0000"
}
]
}