Card class
Card component with consistent styling and multiple variants.
The root is a native <a> when href is provided, a native <button>
when onTap is provided, and a <div> otherwise. href and onTap are
mutually exclusive so navigation and callback semantics cannot conflict.
- Inheritance
Constructors
-
Card({Widget? child, List<
Widget> ? children, CardVariant variant = CardVariant.elevated, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Card.elevated({Widget? child, List<
Widget> ? children, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Card.flat({Widget? child, List<
Widget> ? children, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Card.ghost({Widget? child, List<
Widget> ? children, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Card.glass({Widget? child, List<
Widget> ? children, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Card.interactive({Widget? child, List<
Widget> ? children, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
-
Card.outlined({Widget? child, List<
Widget> ? children, EdgeInsets? padding, BorderRadius? borderRadius, void onTap()?, String? href, String? target, String? rel, String? classes, Map<String, String> ? attributes, String? ariaLabel, String? backgroundColor, bool fillWidth = false, ArcaneStyleData? styles, ArcaneDecoration? decoration, Key? key}) -
const
Properties
- ariaLabel → String?
-
Accessible name for the card's root element. This is most useful when its
visible descendants do not already provide a meaningful name.
final
-
attributes
→ Map<
String, String> ? -
Additional root attributes. Structural attributes owned by Card, such as
href,target,rel,type,class, andstyle, cannot be overridden here.final - backgroundColor → String?
-
final
- borderRadius → BorderRadius?
-
final
- classes → String?
-
Additional CSS classes appended after the theme's card classes.
final
- decoration → ArcaneDecoration?
-
Semantic, theme-interpreted decoration (elevation + theme-specific fields).
final
- fillWidth → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- href → String?
-
Navigation destination. When set, the whole card is a native anchor.
final
- key → Key?
-
Controls how one component replaces another component in the tree.
finalinherited
- padding → EdgeInsets?
-
final
- rel → String?
-
Optional anchor relationship tokens.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- styles → ArcaneStyleData?
-
Literal, theme-permeable style override (always applied, wins over theme).
final
- target → String?
-
Optional anchor browsing context, such as
_blank.final - variant → CardVariant
-
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this component.
override
-
createElement(
) → Element -
Creates a StatelessElement to manage this component's location in the tree.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRebuild(
covariant Component newComponent) → bool -
Implement this method to determine whether a rebuild can be skipped.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited