Skip to main content

Container

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

Properties​

PropertyTypeDescription
alignmentMiraiAlignmentThe alignment of the child within the container.
paddingMiraiEdgeInsetsThe padding to apply around the child.
decorationMiraiBoxDecorationThe decoration to paint behind the child.
foregroundDecorationMiraiBoxDecorationThe decoration to paint in front of the child.
colorStringThe hex color to paint behind the child.
widthdoubleThe width of the container.
heightdoubleThe height of the container.
constraintsMiraiBoxConstraintsAdditional constraints to apply to the container.
marginMiraiEdgeInsetsThe margin to apply around the container.
childMap<String, dynamic>The child widget of the container.
clipBehaviorClipThe clip behavior of the container.

Example JSON​

{
"type": "container",
"alignment": "center",
"padding": {
"top": 16.0,
"bottom": 16.0,
"left": 16.0,
"right": 16.0
},
"decoration": {
"color": "#FF5733",
"borderRadius": {
"topLeft": 16.0,
"topRight": 16.0,
"bottomLeft": 16.0,
"bottomRight": 16.0
}
},
"width": 200.0,
"height": 200.0,
"child": {
"type": "text",
"data": "Hello, World!",
"style": {
"color": "#FFFFFF",
"fontSize": 24.0
}
}
}