Skip to main content
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
colorStacColorThe background color of the card.
shadowColorStacColorThe color of the card’s shadow.
surfaceTintColorStacColorThe color of the card’s surface tint.
elevationdoubleThe z-coordinate at which to place this card.
shapeStacShapeBorderThe shape of the card’s border.
borderOnForegroundboolWhether to paint the border in front of the child. Defaults to true.
marginStacEdgeInsetsThe empty space that surrounds the card.
clipBehaviorStacClipThe content will be clipped (or not) according to this option.
childStacWidgetThe widget below this widget in the tree.
semanticContainerboolWhether this card is a semantic container. Defaults to true.

Example

StacCard(
  color: StacColors.white,
  shadowColor: StacColors.black,
  surfaceTintColor: StacColors.red,
  elevation: 5.0,
  shape: StacRoundedRectangleBorder(borderRadius: 10.0),
  borderOnForeground: true,
  margin: StacEdgeInsets(left: 10, top: 20, right: 10, bottom: 20),
  clipBehavior: StacClip.antiAlias,
  child: StacText(data: 'This is a card.'),
  semanticContainer: true,
)