Instantly share code, notes, and snippets.

Embed
What would you like to do?
class _HeightPickerState extends State<HeightPicker> {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
_drawLabels(),
],
);
}
Widget _drawLabels() {
int labelsToDisplay = widget.totalUnits ~/ 5 + 1;
List<Widget> labels = List.generate(
labelsToDisplay,
(idx) {
return Text(
"${widget.maxHeight - 5 * idx}",
style: labelsTextStyle,
);
},
);
return Align(
alignment: Alignment.centerRight,
child: IgnorePointer(
child: Padding(
padding: EdgeInsets.only(
right: screenAwareSize(12.0, context),
bottom: marginBottomAdapted(context),
top: marginTopAdapted(context),
),
child: Column(
children: labels,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment