controlsBuilder property
The callback for creating custom controls.
If null, the default controls from the current theme will be used.
This callback which takes in a context and two functions,onStepContinue and onStepCancel. These can be used to control the stepper.
{@tool dartpad --template=stateless_widget_scaffold} Creates a stepper control with custom buttons.
Widget build(BuildContext context) {
return Stepper(
controlsBuilder:
(BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) {
return Row(
children: <Widget>[
FlatButton(
onPressed: onStepContinue,
child: const Text('NEXT'),
),
FlatButton(
onPressed: onStepCancel,
child: const Text('CANCEL'),
),
],
);
},
steps: const <Step>[
Step(
title: Text('A'),
content: SizedBox(
width: 100.0,
height: 100.0,
),
),
Step(
title: Text('B'),
content: SizedBox(
width: 100.0,
height: 100.0,
),
),
],
);
}
{@end-tool}
Implementation
final ControlsWidgetBuilder? controlsBuilder;