WheelChooser<T>.integer constructor

WheelChooser<T>.integer({
  1. required dynamic onValueChanged(
    1. dynamic
    )?,
  2. required int maxValue,
  3. required int minValue,
  4. int? initValue,
  5. int step = 1,
  6. TextStyle? selectTextStyle,
  7. TextStyle? unSelectTextStyle,
  8. double squeeze = 1.0,
  9. double itemSize = _defaultItemSize,
  10. double magnification = 1,
  11. double perspective = 0.01,
  12. double? listWidth,
  13. double? listHeight,
  14. FixedExtentScrollController? controller,
  15. bool horizontal = false,
  16. bool isInfinite = false,
  17. ScrollPhysics? physics,
  18. bool reverse = false,
})

Implementation

WheelChooser.integer({
  required this.onValueChanged,
  required int maxValue,
  required int minValue,
  int? initValue,
  int step = 1,
  this.selectTextStyle,
  this.unSelectTextStyle,
  this.squeeze = 1.0,
  this.itemSize = _defaultItemSize,
  this.magnification = 1,
  this.perspective = 0.01,
  this.listWidth,
  this.listHeight,
  this.controller,
  this.horizontal = false,
  this.isInfinite = false,
  this.physics,
  bool reverse = false,
})  : assert(perspective <= 0.01),
      assert(minValue < maxValue),
      assert(initValue == null || initValue >= minValue),
      assert(initValue == null || maxValue >= initValue),
      assert(step > 0),
      assert(controller == null || initValue == null),
      children = null,
      choices = null, onChoiceChanged = null,
      datas = _createIntegerList(minValue, maxValue, step, reverse),
      startPosition = initValue == null
          ? (controller == null ? 0 : null)
          : reverse
              ? (maxValue - initValue) ~/ step
              : (initValue - minValue) ~/ step;