StringPicker constructor Null safety

StringPicker(
  1. {Key? key,
  2. double diameterRatio = kDefaultDiameterRatio,
  3. Color? backgroundColor,
  4. double offAxisFraction = 0.0,
  5. bool useMagnifier = false,
  6. double magnification = 1.0,
  7. FixedExtentScrollController? scrollController,
  8. double squeeze = kSqueeze,
  9. Widget? selectionOverlay = const DefaultSelectionOverlay(),
  10. bool looping = false,
  11. required double itemExtent,
  12. required ValueChanged<String>? onSelectedItemChanged,
  13. required List<String> data,
  14. TextStyle? itemStyle,
  15. Widget? label,
  16. EdgeInsetsGeometry? labelPadding,
  17. AlignmentGeometry labelAlignment = Alignment.center}
)

Implementation

StringPicker({
  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.data,
  this.itemStyle,
  this.label,
  this.labelPadding,
  this.labelAlignment = Alignment.center,
})  : assert(diameterRatio != null),
      assert(diameterRatio > 0.0,
          RenderListWheelViewport.diameterRatioZeroMessage),
      assert(magnification > 0),
      assert(itemExtent != null),
      assert(itemExtent > 0),
      assert(squeeze != null),
      assert(squeeze > 0),
      assert(data != null),
      super(key: key);