TDTimeCounter class
计时组件
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TDTimeCounter
Constructors
- TDTimeCounter({Key? key, bool autoStart = true, dynamic content = 'default', String format = 'HH:mm:ss', bool millisecond = false, TDTimeCounterSize size = TDTimeCounterSize.medium, bool splitWithUnit = false, TDTimeCounterTheme theme = TDTimeCounterTheme.defaultTheme, required int time, TDTimeCounterStyle? style, dynamic onChange(int time)?, VoidCallback? onFinish, TDTimeCounterDirection direction = TDTimeCounterDirection.down, TDTimeCounterController? controller})
-
const
Properties
- autoStart → bool
-
是否自动开始倒计时
final
- content → dynamic
-
'default' / Widget Function(int time) / Widget
final
- controller → TDTimeCounterController?
-
控制器,可控制开始/暂停/继续/重置
final
- direction → TDTimeCounterDirection
-
计时方向,默认倒计时
final
- format → String
-
时间格式,DD-日,HH-时,mm-分,ss-秒,SSS-毫秒(分隔符必须为长度为1的非空格的字符)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- millisecond → bool
-
是否开启毫秒级渲染
final
- onChange → dynamic Function(int time)?
-
时间变化时触发回调
final
- onFinish → VoidCallback?
-
计时结束时触发回调
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → TDTimeCounterSize
-
尺寸
final
- splitWithUnit → bool
-
使用时间单位分割
final
- style → TDTimeCounterStyle?
-
自定义样式,有则优先用它,没有则根据size和theme选取
final
- theme → TDTimeCounterTheme
-
风格
final
- time → int
-
必需;计时时长,单位毫秒
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _TDTimeCounterState -
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