printIndex method
Returns the index of the step with the correct number of spaces, to format the output.
Implementation
String printIndex(int? number) {
return switch (number) {
== null => '',
< 10 => ' $number.',
< 100 => ' $number.',
_ => '$number.',
};
}