Skip to content

Instantly share code, notes, and snippets.

@sanket143
Last active August 20, 2019 18:14
Show Gist options
  • Save sanket143/d370910b25498b0a8dfd496bc0749db8 to your computer and use it in GitHub Desktop.
Save sanket143/d370910b25498b0a8dfd496bc0749db8 to your computer and use it in GitHub Desktop.
// 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