SubZeroCard class

A versatile, self-contained card surface following the SubZero 2.0 Design System.

Supports static (display-only) and interactive (tappable) modes with customizable content areas: header, media, body, and actions.

Example usage:

SubZeroCard(
  header: SubZeroCardHeader(
    title: 'Card Title',
    subtitle: 'Supporting text',
    leading: Icon(Icons.star),
  ),
  media: SubZeroCardMedia(
    imageUrl: 'https://example.com/image.jpg',
    aspectRatio: SubZeroCardMediaRatio.standard,
  ),
  body: Text('Card body content goes here.'),
  actions: [
    SubZeroButton(label: 'Action 1', onPressed: () {}),
  ],
  onTap: () => print('Card tapped'),
)
Inheritance
Available extensions

Constructors

SubZeroCard({Key? key, SubZeroCardHeader? header, SubZeroCardMedia? media, Widget? body, List<Widget>? actions, VoidCallback? onTap, VoidCallback? onLongPress, SubZeroCardElevation elevation = SubZeroCardElevation.medium, BorderRadius? borderRadius, Color? backgroundColor, Color? borderColor, bool showBorder = false, EdgeInsets? padding, double? width, double? height, String? semanticLabel, Clip clipBehavior = Clip.antiAlias})
const

Properties

actions List<Widget>?
Action widgets (typically buttons or icon buttons)
final
backgroundColor Color?
Custom background color (defaults to SubZeroColors.surface)
final
body Widget?
Body content widget
final
borderColor Color?
Custom border color when showBorder is true
final
borderRadius BorderRadius?
Custom border radius (defaults to SubZeroRadius.medium)
final
clipBehavior Clip
How to clip the card content
final
elevation SubZeroCardElevation
Elevation level for the card shadow
final
hashCode int
The hash code for this object.
no setterinherited
Header section configuration
final
height double?
Fixed height (defaults to intrinsic height)
final
isInteractive bool
Whether the card is interactive (has onTap callback)
no setter
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
media SubZeroCardMedia?
Media section configuration
final
onLongPress VoidCallback?
Callback when the card is long-pressed
final
onTap VoidCallback?
Callback when the card is tapped (makes card interactive)
final
padding EdgeInsets?
Custom internal padding (defaults to SubZeroSpacing.md)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
Accessibility label for the entire card
final
showBorder bool
Whether to show a border around the card
final
width double?
Fixed width (defaults to intrinsic width)
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SubZeroCard>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
withCountBadge({required int count, int maxCount = 99, SubZeroBadgeStyle style = SubZeroBadgeStyle.filled, SubZeroBadgeSize size = SubZeroBadgeSize.medium, SubZeroBadgeAlignment alignment = const SubZeroBadgeAlignment(), bool show = true}) Widget

Available on Widget, provided by the SubZeroBadgeExtension extension

Wrap this widget with a count badge
withDotBadge({SubZeroBadgeStyle style = SubZeroBadgeStyle.filled, SubZeroBadgeSize size = SubZeroBadgeSize.medium, SubZeroBadgeAlignment alignment = const SubZeroBadgeAlignment(), bool show = true}) Widget

Available on Widget, provided by the SubZeroBadgeExtension extension

Wrap this widget with a dot badge

Operators

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