Skip to main content

Card

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

Properties​

PropertyTypeDescription
colorString?The background color of the card.
shadowColorString?The color of the card's shadow.
surfaceTintColorString?The color of the card's surface tint.
elevationdouble?The z-coordinate at which to place this card.
shapeStacShapeBorder?The shape of the card's border.
borderOnForegroundboolWhether to paint the border in front of the child. Defaults to true.
marginStacEdgeInsets?The empty space that surrounds the card.
clipBehaviorClip?The content will be clipped (or not) according to this option.
childMap<String, dynamic>?The widget below this widget in the tree.
semanticContainerboolWhether this card is a semantic container. Defaults to true.

Example JSON​

{
"type": "card",
"color": "#FFFFFF",
"shadowColor": "#000000",
"surfaceTintColor": "#FF0000",
"elevation": 5.0,
"shape": {
"type": "roundedRectangle",
"borderRadius": 10.0
},
"borderOnForeground": true,
"margin": {
"left": 10,
"top": 20,
"right": 10,
"bottom": 20
},
"clipBehavior": "antiAlias",
"child": {
"type": "text",
"data": "This is a card."
},
"semanticContainer": true
}