BrnCommonCardTitle class
普通的卡片标题组件
组件的展示规则: 1:标题可以折行展示 2:标题最右侧的widget 需要展示出来 3:标题底部的detail 信息展示的长度是 折行的长度,只显示1行 4:标题的文案和sub需要流式布局
布局间距: 标题 和 最右侧的accessory的间距为 8dp 标题和subTitleWidget的间距为 8dp 标题和底部的间距为 4dp 默认自带上面16的间距
布局规则: 为了保证标题title和最右侧的accessoryWidget居中对齐,accessoryWidget的高度就是25,如果传入的widget过大会显示不全 因为该部分的实现,是通过RichText实现的,并不会截断,会根据文本的多少流式布局
整个组件是可以响应点击事件的onTap
标题为文本、跟随标题为标签、最右侧为自定义Widget BrnCommonCardTitle( title: '非箭头非箭头', accessoryWidget: BrnStateTag(tagText: '状态标签'), subTitleWidget: BrnStartRatingIndicator(rating: 4), onTap: () { BrnToast.show('BrnCommonCardTitle is clicked', context); }, )
标题为文本、最右侧为自定义Widget、标题下方为长文本 BrnCommonCardTitle( title: '非箭头Title', detailTextString: '房产证地址与楼盘字房产证地址与楼盘字房产证地址与楼盘字房产证地址与楼盘字房产证地址与楼盘字', subTitleWidget: BrnStartRatingIndicator(rating: 4), onTap: () { BrnToast.show('BrnCommonCardTitle is clicked', context); }, ) 相关按钮如下:
- BrnActionCardTitle, 右侧为箭头的卡片标题组件
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BrnCommonCardTitle
- Available Extensions
Constructors
- BrnCommonCardTitle({Key? key, required String title, String? accessoryText, Widget? accessoryWidget, VoidCallback? onTap, Widget? subTitleWidget, String? detailTextString, Color? detailColor, PlaceholderAlignment? alignment, EdgeInsetsGeometry? padding, int? titleMaxLines, TextOverflow titleOverflow = TextOverflow.clip, BrnCardTitleConfig? themeData})
-
create BrnCommonCardTitle
const
Properties
- accessoryText → String?
-
最右侧的文字
final
- accessoryWidget → Widget?
-
最右侧的widget 如果两者同时存在 则以widget为主
final
- alignment → PlaceholderAlignment?
-
title的流式文本的对齐方式
final
- detailColor → Color?
-
标题下方文字 默认是深色的222222
final
- detailTextString → String?
-
标题下面的文字
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onTap → VoidCallback?
-
整个区域点击的回调
final
- padding → EdgeInsetsGeometry?
-
内容的padding 默认上16下12 左右0
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subTitleWidget → Widget?
-
标题右侧的显示widget
final
- themeData → BrnCardTitleConfig?
-
the theme config of BrnCommonCardTitle
final
- title → String
-
标题
final
- titleMaxLines → int?
-
标题最大行数
final
- titleOverflow → TextOverflow
-
标题 Overflow 展示方式,默认 TextOverflow.clip
注意,由于 subTitleWidget 与 title 是流式布局,所以 subTitleWidget 会折叠
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
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}) → 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