InputNumber constructor
InputNumber({
- Key? key,
- bool enable = true,
- double width = 120,
- double height = 36,
- int initValue = 0,
- int minValue = 0,
- int maxValue = 100,
- Color? leftButtonBackgroundColor,
- Color? rightButtonBackgroundColor,
- Color? borderColor,
- IconData? leftIcon,
- IconData? rightIcon,
- Color? iconColor,
- Color? iconDisableColor,
- double? iconSize,
- Color? backgroundColor,
- Color? disableBackgroundColor,
- Color? textColor,
- double? textSize,
- Color? disableTextColor,
- double? leftButtonWidth,
- double? rightButtonWidth,
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(3)),
- dynamic buildCall(
- 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);
}
}