AnimatedDigitWidget constructor
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,
Implementation
AnimatedDigitWidget({
Key? key,
TextStyle? textStyle,
this.controller,
this.value,
this.duration = const Duration(milliseconds: 300),
this.curve = Curves.easeInOut,
this.boxDecoration,
this.fractionDigits = 0,
this.enableSeparator = false,
this.separateSymbol = ",",
this.separateLength = 3,
this.decimalSeparator = '.',
this.prefix,
this.suffix,
this.loop = true,
this.autoSize = true,
this.animateAutoSize = true,
this.valueColors,
}) : assert(separateLength >= 1,
"@separateLength at least greater than or equal to 1"),
assert(!(value == null && controller == null),
"the @value & @controller cannot be null at the same time"),
super(key: key) {
if (textStyle != null) {
if (textStyle.color == null) {
_textStyle = textStyle.copyWith(color: Colors.black);
} else {
_textStyle = textStyle;
}
} else {
_textStyle = _$defaultTextStyle;
}
}