You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to add some configuration for integer pickers to zero-pad the numbers displayed in the generated list items?
I have a dialog widget which uses a pair of NumberPicker.integers to select minutes and seconds and gives you back a Duration object, which currently looks like this:
It would be nice to be able to pad the numbers less than 10 out with a zero so they match the way minutes and seconds are displayed elsewhere in the app, e.g. 00 : 09 in the example above.
The text was updated successfully, but these errors were encountered:
A quick fix (even though it is a really bad habit to change library files) is to change line 281 to child: new Text(value.toString().padLeft(2, '0'), style: itemStyle), inside _integerInfiniteListView(). The values will be stored without the padding 0, so you will have to take care of that as well.
Would it be possible to add some configuration for integer pickers to zero-pad the numbers displayed in the generated list items?
I have a dialog widget which uses a pair of
NumberPicker.integer
s to select minutes and seconds and gives you back a Duration object, which currently looks like this:It would be nice to be able to pad the numbers less than 10 out with a zero so they match the way minutes and seconds are displayed elsewhere in the app, e.g. 00 : 09 in the example above.
The text was updated successfully, but these errors were encountered: