diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart old mode 100644 new mode 100755 index 408f5e6f39..fecf8e38c2 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -122,6 +122,57 @@ class Step { /// to this widget based on some logic triggered by the three callbacks that it /// provides. /// +/// {@tool sample --template=stateful_widget_scaffold_center} +/// +/// ```dart +/// int _index = 0; +/// Widget build(BuildContext context) { +/// return Container( +/// height: 300, +/// width: 300, +/// child: Stepper( +/// currentStep: _index, +/// onStepCancel: () { +/// if (_index <= 0) { +/// return; +/// } +/// setState(() { +/// _index--; +/// }); +/// }, +/// onStepContinue: () { +/// if (_index >= 1) { +/// return; +/// } +/// setState(() { +/// _index++; +/// }); +/// }, +/// onStepTapped: (index) { +/// setState(() { +/// _index = index; +/// }); +/// }, +/// steps: [ +/// Step( +/// title: Text("Step 1 title"), +/// content: Container( +/// alignment: Alignment.centerLeft, +/// child: Text("Content for Step 1") +/// ), +/// ), +/// Step( +/// title: Text("Step 2 title"), +/// content: Text("Content for Step 2"), +/// ), +/// ], +/// ), +/// ); +/// } +/// ``` +/// +/// {@end-tool} +/// /// See also: /// /// * [Step]