Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created September 13, 2018 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/97a2dbb0791c6cbdb7a4183f57fe0fcd to your computer and use it in GitHub Desktop.
Save MarcinusX/97a2dbb0791c6cbdb7a4183f57fe0fcd to your computer and use it in GitHub Desktop.
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