title: Flutter : Disable Previous Stepper Click
body: <p>I am using <a href="https://api.flutter.dev/flutter/material/Stepper-class.html" rel="nofollow noreferrer">Stepper</a> Widget to make Change PinCode Form. Everything is okay, but i don't know how to disable previous stepper click.
  <p>Example :</p>
  
  <ul>
  <li>Step 1 Input Old PinCode.</li>
  <li>Step 2 Input New Pincode. </li>
  </ul>
  
  <p>I don't want to go back to step 1 if i am in step 2 by clicking the Stepper.
  <p> How can i solve this ?</p>
  
  <p><a href="https://i.stack.imgur.com/PiZhp.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PiZhp.gif" alt="stepper"></a></p>
  
  <h3>Here's my source Code :</h3>
  
  <pre><code>Form(
          key: _formKey,
          child: Stepper(
            steps: steps(),
            currentStep: currStep,
            onStepContinue: () {
              setState(() {
                if (formKeys[currStep].currentState.validate()) {
                  if (currStep &lt; steps().length - 1) {
                    currStep += 1;
                  } else if (steps().length == 2) {
                    print('Done');
                  } else {
                    currStep = 0;
                  }
                }
              });
            },
            onStepTapped: (step) {
              setState(() {
                currStep = step;
                print(step);
              });
            },
          ),
        ),
   List&lt;Step&gt; steps() {
      return [
        Step(
          title: const Text('Enter Previous PinCode'),
          isActive: currStep == 0 ? true : false,
          state: StepState.indexed,
          content: Form(
            key: formKeys[0],
            child: TextFormField(
              autofocus: true,
              keyboardType: TextInputType.number,
              validator: (value) {
                if (value.isEmpty || value != userModelHive.pinCodeNumber) {
                  return 'PinCode Invalid';
                }
                return null;
              },
            ),
          ),
        ),
        Step(
          title: const Text('Enter New PinCode'),
          isActive: true,
          state: StepState.indexed,
          content: Form(
            key: formKeys[1],
            child: TextFormField(
              autofocus: true,
              keyboardType: TextInputType.number,
              validator: (value) {
                if (value.isEmpty) {
                  return 'Provided PinCode';
                } else if (value.length &lt; 4 || value.length &gt; 6) {
                  return "More than 4 Less than 6";
                }
                return null;
              },
            ),
          ),
        ),
      ];
    }
  </code></pre>