Stepper constructor

const Stepper({
  1. Key? key,
  2. required List<Step> steps,
  3. ScrollController? controller,
  4. ScrollPhysics? physics,
  5. StepperType type = StepperType.vertical,
  6. int currentStep = 0,
  7. ValueChanged<int>? onStepTapped,
  8. VoidCallback? onStepContinue,
  9. VoidCallback? onStepCancel,
  10. ControlsWidgetBuilder? controlsBuilder,
  11. double? elevation,
  12. EdgeInsetsGeometry? margin,
  13. MaterialStateProperty<Color>? connectorColor,
  14. double? connectorThickness,
  15. StepIconBuilder? stepIconBuilder,
  16. double? stepIconHeight,
  17. double? stepIconWidth,
  18. EdgeInsets? stepIconMargin,
  19. Clip clipBehavior = Clip.none,
})

Creates a stepper from a list of steps.

This widget is not meant to be rebuilt with a different list of steps unless a key is provided in order to distinguish the old stepper from the new one.

Implementation

const Stepper({
  super.key,
  required this.steps,
  this.controller,
  this.physics,
  this.type = StepperType.vertical,
  this.currentStep = 0,
  this.onStepTapped,
  this.onStepContinue,
  this.onStepCancel,
  this.controlsBuilder,
  this.elevation,
  this.margin,
  this.connectorColor,
  this.connectorThickness,
  this.stepIconBuilder,
  this.stepIconHeight,
  this.stepIconWidth,
  this.stepIconMargin,
  this.clipBehavior = Clip.none,
})  : assert(0 <= currentStep && currentStep < steps.length),
      assert(stepIconHeight == null || (stepIconHeight >= _kStepSize && stepIconHeight <= _kMaxStepSize),
          'stepIconHeight must be greater than $_kStepSize and less or equal to $_kMaxStepSize'),
      assert(stepIconWidth == null || (stepIconWidth >= _kStepSize && stepIconWidth <= _kMaxStepSize),
          'stepIconWidth must be greater than $_kStepSize and less or equal to $_kMaxStepSize'),
      assert(
          stepIconHeight == null || stepIconWidth == null || stepIconHeight == stepIconWidth,
          'If either stepIconHeight or stepIconWidth is specified, both must be specified and '
          'the values must be equal.');