Last active
August 20, 2019 18:14
-
-
Save sanket143/d370910b25498b0a8dfd496bc0749db8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace _buildVertical() function of | |
// flutter/packages/flutter/lib/src/material/stepper.dart | |
Widget _buildVertical() { | |
return ListView.builder( | |
shrinkWrap: true, | |
itemCount: widget.steps.length, | |
itemBuilder: (BuildContext context, int i){ | |
i < _keys.length ? _keys[i] : _keys.add(GlobalKey()); | |
return Column( | |
key: _keys[i], | |
children: <Widget>[ | |
InkWell( | |
onTap: widget.steps[i].state != StepState.disabled ? () { | |
// In the vertical case we need to scroll to the newly tapped | |
// step. | |
Scrollable.ensureVisible( | |
_keys[i].currentContext, | |
curve: Curves.fastOutSlowIn, | |
duration: kThemeAnimationDuration, | |
); | |
if (widget.onStepTapped != null) | |
widget.onStepTapped(i); | |
} : null, | |
child: _buildVerticalHeader(i) | |
), | |
_buildVerticalBody(i) | |
] | |
); | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment