SCard class

Inheritance

Constructors

SCard.new({Key? key, String? title, TextStyle? titleStyle, String? description, TextStyle? descriptionStyle, Widget? header, Widget? body, Widget? actions, Widget? footer, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? headerPadding, EdgeInsetsGeometry? bodyPadding, EdgeInsetsGeometry? actionsPadding, EdgeInsetsGeometry? footerPadding, double? elevation = 1.0, double? height = 100, double? width, double? maxWidth, double? maxHeight, AlignmentGeometry? alignment, Color? color = Colors.white, Gradient? gradient, ImageProvider<Object>? backgroundImage, BoxFit? backgroundFit = BoxFit.cover, BlendMode? backgroundBlendMode, SCardShape shape = SCardShape.rounded, ShapeBorder? customShape, SCardShadow shadowStyle = SCardShadow.subtle, BoxShadow? customShadow, IconData? dismissIcon, IconData? dismissSecondaryIcon, Color? borderColor, double? borderWidth = 1.0, double? borderRadius = 12.0, Color? shadowColor, Offset? shadowOffset, double? blurRadius, double? spreadRadius, VoidCallback? onTap, VoidCallback? onLongPress, ValueChanged<bool>? onHover, ScrollPhysics? onScroll, GestureTapCallback? onDoubleTap, bool enableFeedback = true, bool enableInteractiveDismiss = true, Duration? animationDuration = const Duration(milliseconds: 200), Curve? animationCurve = Curves.easeInOut, bool animateOnLoad = false, double? hoverElevation = 4.0, Color? hoverColor, double? tapScale = 0.95, Key? dismissKey, Widget? dismissBackground, Widget? dismissSecondaryBackground, Future<bool?> confirmDismiss(DismissDirection)?, void onDismissed(DismissDirection)?, DismissDirection direction = DismissDirection.horizontal, Duration resizeDuration = const Duration(milliseconds: 300), Map<DismissDirection, double> dismissThresholds = const <DismissDirection, double>{}, Duration movementDuration = const Duration(milliseconds: 200), double crossAxisEndOffset = 0.0, DragStartBehavior dragStartBehavior = DragStartBehavior.start, HitTestBehavior behavior = HitTestBehavior.opaque, Color? dismissBackgroundColor, Color? dismissSecondaryBackgroundColor, String? dismissBackgroundLabel, String? dismissSecondaryBackgroundLabel, TextStyle? dismissBackgroundLabelStyle, TextStyle? dismissSecondaryBackgroundLabelStyle, double? dismissBackgroundOpacity = 1.0, Curve? dismissBackgroundAnimationCurve = Curves.linear, EdgeInsetsGeometry? dismissBackgroundPadding, AlignmentGeometry? dismissBackgroundAlignment, String? semanticLabel, String? semanticValue, String? semanticHint, String? semanticTooltip, bool? semanticEnabled, bool? semanticChecked, bool? semanticSelected, bool? semanticToggled, bool? semanticButton, bool? semanticHeader, int? semanticHeadingLevel, bool? semanticTextField, bool? semanticReadOnly, bool? semanticFocusable, bool? semanticFocused, bool? semanticHidden, bool? semanticImage, bool? semanticLiveRegion, String? onTapHint, String? onLongPressHint, VoidCallback? onScrollLeft, VoidCallback? onScrollRight, VoidCallback? onScrollUp, VoidCallback? onScrollDown, VoidCallback? onIncrease, VoidCallback? onDecrease, VoidCallback? onDismissSemantics, Map<CustomSemanticsAction, VoidCallback>? customSemanticsActions, TextDirection? textDirection, FocusNode? focusNode, bool canRequestFocus = true, bool isDraggable = false, ScrollController? scrollController, Border? customBorder, Clip clipBehavior = Clip.antiAlias, MaterialType materialType = MaterialType.card, List<BoxShadow>? additionalShadows, BlendMode? colorBlendMode})
const

Properties

actions Widget?
Widget for action buttons or controls.
final
actionsPadding EdgeInsetsGeometry?
Padding specifically for the actions section.
final
additionalShadows List<BoxShadow>?
Additional shadows for the card.
final
alignment AlignmentGeometry?
Alignment of the card's content.
final
animateOnLoad bool
Triggers animation when the card loads. Defaults to false.
final
animationCurve Curve?
Curve for animations. Defaults to Curves.easeInOut.
final
animationDuration Duration?
Duration of animations (e.g., scale, dismiss). Defaults to 200ms.
final
backgroundBlendMode BlendMode?
Blend mode for the background image.
final
backgroundFit BoxFit?
Fit style for the background image. Defaults to BoxFit.cover.
final
backgroundImage ImageProvider<Object>?
Background image for the card. Cannot be used with gradient.
final
behavior HitTestBehavior
Hit test behavior for interactions. Defaults to HitTestBehavior.opaque.
final
blurRadius double?
Blur radius for the card's shadow.
final
body Widget?
Main content widget of the card.
final
bodyPadding EdgeInsetsGeometry?
Padding specifically for the body section.
final
borderColor Color?
Color of the card's border.
final
borderRadius double?
Radius for rounded corners when shape is rounded. Defaults to 12.0.
final
borderWidth double?
Width of the card's border. Defaults to 1.0.
final
canRequestFocus bool
Determines if the card can request focus. Defaults to true.
final
clipBehavior Clip
Clipping behavior for the card's content. Defaults to Clip.antiAlias.
final
color Color?
Background color of the card. Defaults to white.
final
colorBlendMode BlendMode?
Blend mode for the card's color.
final
confirmDismiss Future<bool?> Function(DismissDirection)?
Callback to confirm dismiss action.
final
crossAxisEndOffset double
Offset for cross-axis movement during dismiss. Defaults to 0.0.
final
customBorder Border?
Custom border for the card.
final
customSemanticsActions Map<CustomSemanticsAction, VoidCallback>?
Custom semantic actions for accessibility.
final
customShadow BoxShadow?
Custom shadow when shadowStyle is SCardShadow.custom.
final
customShape ShapeBorder?
Custom shape border when shape is SCardShape.custom.
final
description String?
Description text shown below the title in the header.
final
descriptionStyle TextStyle?
Custom text style for the description.
final
direction DismissDirection
Direction for dismissible swipe (e.g., horizontal, vertical). Defaults to horizontal.
final
dismissBackground Widget?
Custom background widget for dismissible (end-to-start swipe).
final
dismissBackgroundAlignment AlignmentGeometry?
Alignment for dismissible background content.
final
dismissBackgroundAnimationCurve Curve?
Animation curve for dismissible background. Defaults to Curves.linear.
final
dismissBackgroundColor Color?
Background color for dismissible (end-to-start swipe). Defaults to red.
final
dismissBackgroundLabel String?
Label text for dismissible background (end-to-start swipe). Defaults to 'Delete'.
final
dismissBackgroundLabelStyle TextStyle?
Text style for dismissible background label.
final
dismissBackgroundOpacity double?
Opacity for dismissible background. Defaults to 1.0.
final
dismissBackgroundPadding EdgeInsetsGeometry?
Padding for dismissible background.
final
dismissIcon IconData?
Icon for the dismissible background (end-to-start swipe).
final
dismissKey Key?
Unique key for dismissible functionality.
final
dismissSecondaryBackground Widget?
Custom secondary background widget for dismissible (start-to-end swipe).
final
dismissSecondaryBackgroundColor Color?
Background color for secondary dismissible (start-to-end swipe). Defaults to green.
final
dismissSecondaryBackgroundLabel String?
Label text for secondary dismissible background (start-to-end swipe). Defaults to 'Confirm'.
final
dismissSecondaryBackgroundLabelStyle TextStyle?
Text style for secondary dismissible background label.
final
dismissSecondaryIcon IconData?
Icon for the secondary dismissible background (start-to-end swipe).
final
dismissThresholds Map<DismissDirection, double>
Thresholds for dismiss sensitivity by direction. Defaults to empty map.
final
dragStartBehavior DragStartBehavior
Behavior for starting drag gestures. Defaults to DragStartBehavior.start.
final
elevation double?
Elevation for the card's shadow depth. Defaults to 1.0.
final
enableFeedback bool
Enables haptic and sound feedback for interactions. Defaults to true.
final
enableInteractiveDismiss bool
Enables swipe-to-dismiss functionality. Defaults to true.
final
focusNode FocusNode?
Focus node for managing focus.
final
Custom widget for the card's footer section.
final
footerPadding EdgeInsetsGeometry?
Padding specifically for the footer section.
final
gradient Gradient?
Gradient background for the card. Cannot be used with backgroundImage.
final
hashCode int
The hash code for this object.
no setterinherited
Custom widget for the card's header section.
final
headerPadding EdgeInsetsGeometry?
Padding specifically for the header section.
final
height double?
Fixed height of the card. Defaults to 100.
final
hoverColor Color?
Background color when the card is hovered.
final
hoverElevation double?
Elevation when the card is hovered. Defaults to 4.0.
final
isDraggable bool
Enables drag-and-drop functionality. Defaults to false.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
Margin around the card.
final
materialType MaterialType
Material type for the card (e.g., card, canvas). Defaults to MaterialType.card.
final
maxHeight double?
Maximum height constraint for the card.
final
maxWidth double?
Maximum width constraint for the card.
final
movementDuration Duration
Duration for dismiss movement animation. Defaults to 200ms.
final
onDecrease VoidCallback?
Callback for decreasing a value.
final
onDismissed → void Function(DismissDirection)?
Callback triggered when the card is dismissed.
final
onDismissSemantics VoidCallback?
Callback for dismiss action for accessibility.
final
onDoubleTap GestureTapCallback?
Callback triggered on double tap.
final
onHover ValueChanged<bool>?
Callback triggered on hover, passing hover state.
final
onIncrease VoidCallback?
Callback for increasing a value.
final
onLongPress VoidCallback?
Callback triggered on long press.
final
onLongPressHint String?
Hint for long press action for accessibility.
final
onScroll ScrollPhysics?
Scroll physics for the card's content.
final
onScrollDown VoidCallback?
Callback for scrolling down.
final
onScrollLeft VoidCallback?
Callback for scrolling left.
final
onScrollRight VoidCallback?
Callback for scrolling right.
final
onScrollUp VoidCallback?
Callback for scrolling up.
final
onTap VoidCallback?
Callback triggered on tap.
final
onTapHint String?
Hint for tap action for accessibility. Defaults to 'Tap to interact'.
final
padding EdgeInsetsGeometry?
Padding inside the card for all content.
final
resizeDuration Duration
Duration for resizing during dismiss animation. Defaults to 300ms.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
Controller for scrolling behavior.
final
semanticButton bool?
Indicates if the card is a button for accessibility. Defaults to true if onTap is set.
final
semanticChecked bool?
Indicates if the card is checked for accessibility.
final
semanticEnabled bool?
Indicates if the card is enabled for accessibility. Defaults to true if onTap is set.
final
semanticFocusable bool?
Indicates if the card is focusable for accessibility. Defaults to true.
final
semanticFocused bool?
Indicates if the card is focused for accessibility.
final
semanticHeader bool?
Indicates if the card is a header for accessibility.
final
semanticHeadingLevel int?
Heading level for accessibility (e.g., 1 to 6).
final
semanticHidden bool?
Indicates if the card is hidden for accessibility.
final
semanticHint String?
Semantic hint for accessibility, typically the description.
final
semanticImage bool?
Indicates if the card is an image for accessibility.
final
semanticLabel String?
Semantic label for accessibility, typically the title.
final
semanticLiveRegion bool?
Indicates if the card is a live region for accessibility.
final
semanticReadOnly bool?
Indicates if the card is read-only for accessibility.
final
semanticSelected bool?
Indicates if the card is selected for accessibility.
final
semanticTextField bool?
Indicates if the card is a text field for accessibility.
final
semanticToggled bool?
Indicates if the card is toggled for accessibility.
final
semanticTooltip String?
Semantic tooltip for accessibility.
final
semanticValue String?
Semantic value for accessibility.
final
shadowColor Color?
Color of the card's shadow.
final
shadowOffset Offset?
Offset for the card's shadow.
final
shadowStyle SCardShadow
Shadow style of the card (e.g., none, subtle). Defaults to subtle.
final
shape SCardShape
Shape style of the card (e.g., rounded, circular). Defaults to rounded.
final
spreadRadius double?
Spread radius for the card's shadow.
final
tapScale double?
Scale factor when the card is tapped. Defaults to 0.95.
final
textDirection TextDirection?
Text direction for content (e.g., left-to-right, right-to-left).
final
title String?
Title text displayed in the card's header.
final
titleStyle TextStyle?
Custom text style for the title.
final
width double?
Fixed width of the card.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SCard>
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

Operators

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