NumberPicker constructor
NumberPicker({
- Key? key,
- double diameterRatio = kDefaultDiameterRatio,
- Color? backgroundColor,
- double offAxisFraction = 0.0,
- bool useMagnifier = false,
- double magnification = 1.0,
- FixedExtentScrollController? scrollController,
- double squeeze = kSqueeze,
- Widget? selectionOverlay = const DefaultSelectionOverlay(),
- bool looping = false,
- required double itemExtent,
- required ValueChanged<
num> ? onSelectedItemChanged, - required num max,
- required num min,
- required num interval,
- NumIndexFormatter? indexFormat,
- TextStyle? textStyle,
- Widget? label,
- EdgeInsetsGeometry? labelPadding,
- AlignmentGeometry labelAlignment = Alignment.center,
Implementation
NumberPicker({
Key? key,
this.diameterRatio = kDefaultDiameterRatio,
this.backgroundColor,
this.offAxisFraction = 0.0,
this.useMagnifier = false,
this.magnification = 1.0,
this.scrollController,
this.squeeze = kSqueeze,
this.selectionOverlay = const DefaultSelectionOverlay(),
this.looping = false,
required this.itemExtent,
required this.onSelectedItemChanged,
required this.max,
required this.min,
required this.interval,
this.indexFormat,
this.textStyle,
this.label,
this.labelPadding,
this.labelAlignment = Alignment.center,
}) : assert(min <= max),
assert(diameterRatio > 0.0,
RenderListWheelViewport.diameterRatioZeroMessage),
assert(magnification > 0),
assert(itemExtent > 0),
assert(squeeze > 0),
super(key: key);