StacCard class

A Stac model representing Flutter's Card widget.

Displays material design cards with optional elevation, shape, colors, margin, and clipping. Renders its child.

{@tool snippet} Dart Example:

StacCard(
  elevation: 2,
  margin: StacEdgeInsets.all(8),
  child: StacText(data: 'Hello'),
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "card",
  "elevation": 2,
  "margin": {"all": 8},
  "child": {"type": "text", "data": "Hello"}
}

{@end-tool}

See also:

  • Flutter's Card documentation (https://api.flutter.dev/flutter/material/Card-class.html)
Inheritance
Annotations
  • @JsonSerializable(explicitToJson: true)

Constructors

StacCard.new({StacColor? color, StacColor? shadowColor, StacColor? surfaceTintColor, double? elevation, StacShapeBorder? shape, bool? borderOnForeground, StacEdgeInsets? margin, StacClip? clipBehavior, StacWidget? child, bool? semanticContainer})
Creates a StacCard.
const
StacCard.fromJson(Map<String, dynamic> json)
Creates a StacCard from a JSON map.
factory

Properties

borderOnForeground bool?
Whether to paint the border in front of the child.
final
child StacWidget?
The widget below this card in the tree.
final
clipBehavior StacClip?
How to clip the content.
final
color StacColor?
The background color of the card.
final
elevation double?
The z-coordinate of this card relative to its parent.
final
hashCode int
The hash code for this object.
no setterinherited
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
margin StacEdgeInsets?
Empty space to surround the card.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticContainer bool?
Whether this card represents a semantic container.
final
shadowColor StacColor?
The color of the card's shadow.
final
shape StacShapeBorder?
The shape of the card's material.
final
surfaceTintColor StacColor?
The color used to tint the surface of this card.
final
type String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this StacCard instance to a JSON map.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited