InputNumber constructor

InputNumber({
  1. Key? key,
  2. bool enable = true,
  3. double width = 120,
  4. double height = 36,
  5. int initValue = 0,
  6. int minValue = 0,
  7. int maxValue = 100,
  8. Color? leftButtonBackgroundColor,
  9. Color? rightButtonBackgroundColor,
  10. Color? borderColor,
  11. IconData? leftIcon,
  12. IconData? rightIcon,
  13. Color? iconColor,
  14. Color? iconDisableColor,
  15. double? iconSize,
  16. Color? backgroundColor,
  17. Color? disableBackgroundColor,
  18. Color? textColor,
  19. double? textSize,
  20. Color? disableTextColor,
  21. double? leftButtonWidth,
  22. double? rightButtonWidth,
  23. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(3)),
  24. dynamic buildCall(
    1. InputNumberController controller
    )?,
})

Implementation

InputNumber({
  Key? key,
  this.enable = true,
  this.width = 120,
  this.height = 36,
  this.initValue = 0,
  this.minValue = 0,
  this.maxValue = 100,
  this.leftButtonBackgroundColor,
  this.rightButtonBackgroundColor,
  this.borderColor,
  this.leftIcon,
  this.rightIcon,
  this.iconColor,
  this.iconDisableColor,
  this.iconSize,
  this.backgroundColor,
  this.disableBackgroundColor,
  this.textColor,
  this.textSize,
  this.disableTextColor,
  this.leftButtonWidth,
  this.rightButtonWidth,
  this.borderRadius = const BorderRadius.all(Radius.circular(3)),
  this.buildCall,
}) : super(key: key) {
  if (minValue <= maxValue) {
    numberModel.min = minValue;
    numberModel.max = maxValue;
  }
  if (initValue >= 0) {
    if (initValue > maxValue) {
      numberModel.inputValue = maxValue.toString();
    } else {
      numberModel.inputValue = initValue.toString();
    }
  }
  if (buildCall != null) {
    buildCall!(this);
  }
}