AnimatedDigitWidget class Null safety

动画数字 Widget

1.
- - - - - - - - - - - - - - - - -
// easy
AnimatedDigitWidget(value: 1314)
// easy 2
AnimatedDigitWidget(
  value: 1314,
  loop: true,
  autoSize: true,
)
- - - - - - - - - - - - - - - - -

2.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// 声明控制器
AnimatedDigitController _controller = AnimatedDigitController(99.99);

// build widget
AnimatedDigitWidget(
  controller: _controller,
  textStyle: TextStyle(color: Color(0xff009668)),
  fractionDigits: 2, // 带两位小数
  enableSeparator: true, // 启用千位数字分隔符
)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Inheritance

Constructors

AnimatedDigitWidget({Key? key, TextStyle? textStyle, AnimatedDigitController? controller, num? value, Duration duration = const Duration(milliseconds: 300), Curve curve = Curves.easeInOut, BoxDecoration? boxDecoration, int fractionDigits = 0, bool enableSeparator = false, String? separateSymbol = ",", int separateLength = 3, String decimalSeparator = '.', String? prefix, String? suffix, bool loop = true, bool autoSize = true, bool animateAutoSize = true, List<ValueColor>? valueColors})
see AnimatedDigitWidget

Properties

animateAutoSize bool
在自适应调整 digit/symbol 文本的大小的时候是否是动画的
final
autoSize bool
自适应调整 digit/symbol 文本的大小, 只在未自定义 Size 的情况下有效 SingleDigitData.size == null
final
boxDecoration BoxDecoration?
等同于 Container BoxDecoration 的用法 是对每一个字符生效
final
controller AnimatedDigitController?
数字控制器 | digit controller
final
curve Curve
动画曲线 | animate curve
final
decimalSeparator String
Insert a symbol between the integer part and the fractional part.
final
duration Duration
动画时间 | animate duration
final
enableSeparator bool
orgin params => enableDigitSplit `>=v3.1.0` not available
final
fractionDigits int
小数位(1000520.987)
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loop bool
数字采用循环滚动。
final
prefix String?
The text to display in front of the counter.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
separateLength int
orgin params => separatorDigits `>=v3.1.0` not available
final
separateSymbol String?
orgin params => digitSplitSymbol `>=v3.1.0` not available
final
suffix String?
The text to display after the counter.
final
value num?
动画的数字,当没有 controller 时生效,用于不需要额外控制数字时,同时存在时,controller 具有更高的优先级
final
valueColors List<ValueColor>?
根据值变化颜色的集合
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _AnimatedDigitWidgetState
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.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.
@nonVirtualinherited