Created
May 8, 2020 16:12
-
-
Save becek2n/941ada61a41c821959c0ffa4901c55ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _typeStep() => Container( | |
child: Stepper( | |
controlsBuilder: (BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) { | |
return Padding( | |
padding: EdgeInsets.all(8.0), | |
child: RaisedButton( | |
onPressed: () { | |
setState(() { | |
currentStep < spr.length - 1 ? currentStep += 1 : currentStep = 0; | |
}); | |
}, | |
color: Colors.blue, | |
textColor: Colors.white, | |
child: Text('Next'), | |
), | |
); | |
}, | |
steps: _getSteps(), | |
currentStep: currentStep, | |
type: StepperType.horizontal, | |
onStepTapped: (step) { | |
setState(() { | |
currentStep = step; | |
print(step); | |
}); | |
}, | |
onStepCancel: () { | |
setState(() { | |
currentStep > 0 ? currentStep -= 1 : currentStep = 0; | |
}); | |
}, | |
onStepContinue: () { | |
setState(() { | |
currentStep < spr.length - 1 ? currentStep += 1 : currentStep = 0; | |
}); | |
}, | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment