Skip to main content

Limited Box

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

Properties​

PropertyTypeDescription
maxHeightdoubleThe maximum height for the child if the parent's height is unbounded. Defaults to double.infinity.
maxWidthdoubleThe maximum width for the child if the parent's width is unbounded. Defaults to double.infinity.
childMap<String, dynamic>?The child widget represented as a JSON object.

Example JSON​

Example 1: Limited Box with Default Constraints​

{
"type": "limitedBox",
"child": {
"type": "container",
"width": 100,
"height": 100,
"color": "#FF0000"
}
}

Example 2: Limited Box with Custom Constraints​

{
"type": "limitedBox",
"maxHeight": 200.0,
"maxWidth": 300.0,
"child": {
"type": "text",
"data": "Hello, World! from Limited Box",
"style": {
"fontSize": 16,
"color": "#000000"
}
}
}