WizardController constructor

WizardController({
  1. required List<WizardStepController> stepControllers,
  2. int initialIndex = 0,
  3. StepCallback? onStepChanged,
})

Coordinates the wizard steps and its input control states

stepStates: The step states. This property determines the order of the steps. Also this step can contain ever state management solution that you wish. A list of providers, bloc, etc can be passed in here.

stepBuilder: The builder method to build the step view. The builder method provides the BuildContext and WizardStepState. The state can then be used to determine how to build the view.

Example:

stepBuilder: (context, state) {
  if (state is StepOneProvider) {
    return StepOne(
      provider: state,
    );
  }
  if (state is StepTwoProvider) {
    return StepTwo(
      provider: state,
    );
  }
  return Container();
},

initialIndex: Indicates the initial index of the wizard.

initialIsPreviousEnabled: Indicates if the previous button will be enabled on the initial load.

initialIsNextEnabled: Indicates if the previous button will be enabled on the initial load.

initialIsFinishEnabled: Indicates if the finish button will be enabled on the initial load.

onStepChanged: Callback that gets triggered when the step changes.

onForcedAnimateBackCallback: Callback that gets triggered when the disableGoNext forces the wizard to animate to a lower index.

Implementation

factory WizardController({
  required List<WizardStepController> stepControllers,
  int initialIndex = 0,
  StepCallback? onStepChanged,
}) {
  return WizardControllerImpl(
    stepControllers: stepControllers,
    initialIndex: initialIndex,
    onStepChanged: onStepChanged,
  );
}