BrnStepLine class

contentWidget的左侧自动添加 竖向步骤条的组件

支持isDashLine是否为虚线,在虚线的情况下,支持设置虚线每一段的间隔dashSpace和每个虚线段的长度dashLength.

线的顶端是图片,支持iconWidget配置。

常用情况: 快递时间节点、跟进时间节点、日历时间节点等等

如果不想显示分割线,那么可以将lineColor 设置为透明色

该组件支持设置为灰色模式isGrey,在灰色模式下 线条颜色和icon颜色都是灰色

布局步骤同CustomPaint,因此iconWidgetcontentWidget是顶部对齐的。 如果想要设置icon的偏移,可以通过iconTopPadding设置

最后一个的竖线不显示 ListView.builder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemCount: 5, itemBuilder: (context, index) { if (index == 4) { return BrnStepLineWidget( lineWidth: 1, lineColor: Colors.transparent, contentWidget: Container( height: 50, color: getRandomColor(), ), ); } return BrnStepLineWidget( lineWidth: 1, contentWidget: Container( height: 50, color: getRandomColor(), ), ); }, ),

最后一个的竖线有颜色变化 ListView.builder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), itemCount: 5, itemBuilder: (context, index) { if (index == 4) { return BrnStepLineWidget( lineWidth: 1, lineColor:

Inheritance

Constructors

BrnStepLine({Key? key, required Widget contentWidget, bool isGrey = false, dynamic lineColor, double lineWidth = 2, double iconTopPadding = 0, bool isDashLine = false, double dashLength = 4, double dashSpace = 4, double contentLeftPadding = 12, Color? normalColor, Color? highlightColor, Widget? iconWidget})
const

Properties

contentLeftPadding double
contentWidget距离左侧的padding
final
contentWidget Widget
边框包裹的widget
final
dashLength double
每段虚线的长度
final
dashSpace double
每段虚线的间隔
final
hashCode int
The hash code for this object.
no setterinherited
highlightColor Color?
高亮状态(isGrey=false)的颜色,默认值,主题色
final
iconTopPadding double
icon距离顶部的padding
final
iconWidget Widget?
自定义icon的widget
final
isDashLine bool
是否画虚线
final
isGrey bool
整体是否是灰色,true 则使用normalColor,否则使用highlightColor
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lineColor → dynamic
边框线的颜色:必须是Color 或者 List
final
lineWidth double
线的宽度
final
normalColor Color?
普通状态(isGrey=true)的颜色,默认值: Color(0xffeeeeee)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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