AnimatedDigitWidget constructor

AnimatedDigitWidget({
  1. Key? key,
  2. TextStyle? textStyle,
  3. AnimatedDigitController? controller,
  4. num? value,
  5. Duration duration = const Duration(milliseconds: 300),
  6. Curve curve = Curves.easeInOut,
  7. BoxDecoration? boxDecoration,
  8. int fractionDigits = 0,
  9. bool enableSeparator = false,
  10. String? separateSymbol = ",",
  11. int separateLength = 3,
  12. String decimalSeparator = '.',
  13. String? prefix,
  14. String? suffix,
  15. bool loop = true,
  16. bool autoSize = true,
  17. bool animateAutoSize = true,
  18. 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;
  }
}