Skip to content

Instantly share code, notes, and snippets.

@becek2n
Created May 8, 2020 16:12
Show Gist options
  • Save becek2n/941ada61a41c821959c0ffa4901c55ee to your computer and use it in GitHub Desktop.
Save becek2n/941ada61a41c821959c0ffa4901c55ee to your computer and use it in GitHub Desktop.
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