-
-
Save MarcinusX/97a2dbb0791c6cbdb7a4183f57fe0fcd 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
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