fix: refactor Stepper.controlsBuilder to use ControlsDetails (#88538)

* changed controlsBuilder signature

combined all parameters into ControlsDetails class

* sample fixes

* updates to docstrings

* switched to positional argument for stepper.controlsbuilder

* Merge branch 'master' into stepper-builder-fix
This commit is contained in:
Craig Labenz
2021-08-27 11:26:29 -07:00
committed by GitHub
parent ca077d4345
commit 3a1b04952b
4 changed files with 205 additions and 25 deletions

View File

@@ -49,16 +49,15 @@ class MyStatelessWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Stepper(
controlsBuilder: (BuildContext context,
{VoidCallback? onStepContinue, VoidCallback? onStepCancel}) {
controlsBuilder: (BuildContext context, ControlsDetails details) {
return Row(
children: <Widget>[
TextButton(
onPressed: onStepContinue,
onPressed: details.onStepContinue,
child: const Text('NEXT'),
),
TextButton(
onPressed: onStepCancel,
onPressed: details.onStepCancel,
child: const Text('CANCEL'),
),
],