Unverified Commit 600c9921 authored by Harsh Mehta's avatar Harsh Mehta Committed by GitHub

AdoptAWidget: Stepper (#70092)

* interactive dartpad sample added

* cleaner code

* removed extra spaces

* minor spaces added

* removed null returns
parent 6f70a29c
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment