CxCard class

Card Component

CxCard is a box. The box includes head,body and foot. The box's properties like radius, bgColor,margin, shadow, boxShadow, minHeight.

The default head includes title, subtitle and actions. You should use titleWidget to overload the title. The default title has other arguments that decorates it.

Under the head that is hdsplit. it's splites the head and card's body. it inclues hdSplit, hdSplitHeight, hdSplitMargin, hdSplitColor.

Card's body is required. You can use Widget components to set if you want.

Card's foot includes foot and footWidget, You can select one of the both.

In this example, it's simple for using.

{@tool snippet}

CxCard(
  title: "Card Title",
  subtitle: "Card subtitle",
  body: const Text("hello, card"),
)

{@end-tool}

Inheritance

Constructors

CxCard({Key? key, double? radius, EdgeInsetsGeometry? margin, bool? shadow, BoxShadow? boxShadow, Color? shadowColor, String? title, Color? titleColor, String? subtitle, Color? subtitleColor, double? titleSize, double? subtitleSize, Widget? titleWidget, Widget? foot, required Widget body, List<Widget>? actions, Color? bgColor, double? minHeight, Widget? footWidget, Color? hdBgColor, EdgeInsetsGeometry? hdPadding, bool? hdSplit, Color? hdSplitColor, double? hdSplitHeight, EdgeInsetsGeometry? hdSplitMargin, Widget? hdSplitWidget})
const

Properties

actions List<Widget>?
默认头部组件的右边元素项。
final
bgColor Color?
盒子背景色。默认为 Theme.of(context).colorScheme.background
final
body Widget
Card的主区域部分, 这个是必须参数。类型为Widget
final
boxShadow BoxShadow?
盒子阴影。这个属性是由用户自己设置阴影。 它与默认阴影控制,只能二选一。
final
Card的尾部组件。这个不是必须的。 类型为Widget
final
footWidget Widget?
footWidget与foot二选一。footWidget优先。
final
hashCode int
The hash code for this object.
no setterinherited
hdBgColor Color?
Card的头部组件的背景色。默认为透明色.
final
hdPadding EdgeInsetsGeometry?
Card的头部组件的内间隙. 默认为8个像素间隙。
final
hdSplit bool?
是否显示分割组件. 默认不显示。
final
hdSplitColor Color?
分割组件的颜色. 默认颜色为Colors.grey[100]
final
hdSplitHeight double?
默认分割组件的高度.默认为1.
final
hdSplitMargin EdgeInsetsGeometry?
默认分割组件的外边距.
final
hdSplitWidget Widget?
头部组件的底部分割组件。这个和默认分割组件,二选一.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsetsGeometry?
外边距的控制,类型EdgeInsetsGeometry, 通过调用该类的方法来控制其外边距
final
minHeight double?
盒子的最小高度。 默认为 80.
final
radius double?
Card圆角属性,默认是0。 圆角是控制四个角的,目前无法单独控制某个角。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadow bool?
是否开启盒子阴影。 默认为 false
final
shadowColor Color?
默认盒子阴影颜色。 默认颜色为 Colors.grey.withAlpha(160)
final
subtitle String?
Card的子标题
final
subtitleColor Color?
子标题颜色。 默认为主题色的hintColor
final
subtitleSize double?
子标题大小. 默认大小为12
final
title String?
Card的标题。
final
titleColor Color?
标题颜色。默认为主题色的 cardTheme.color
final
titleSize double?
标题的大小。 默认大小为14
final
titleWidget Widget?
Card头部组件。 如果设置了titleWidget, 则默认的头部组件将被覆盖。头部由用户自己控制。
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
buildBd(BuildContext context) Widget
buildFt() Widget
buildHd(BuildContext context) Widget
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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