sequence method

String sequence(
  1. int index
)

Use Case:

OrderedListSequence.number.sequence(index)

Example:

Number sequence generation like: OrderedListStyle.number

1, 2, 3, ..., 97, 98, 99, ..., 100, 101, ...

Lowercase alphabetic sequence generation like: OrderedListStyle.lowerAlpha

a, b, c, ..., aa, ab, ac, ..., aba, abb, ...

Uppercase alphabetic sequence generation like: OrderedListStyle.upperAlpha

A, B, C, ..., AA, AB, AC, ..., ABA, ABB, ...

Lowercase Roman numeral sequence generation like: OrderedListStyle.lowerRoman

i, ii, iii, ..., xcvii, xcviii, xcix, ..., c, ci, ...

Uppercase Roman numeral sequence generation like: OrderedListStyle.upperRoman

I, II, III, ..., XCVII, XCVIII, XCIX, ..., C, CI, ...

Lowercase Greek letter sequence generation like: OrderedListStyle.lowerGreek

α, β, γ, ..., αα, αβ, αγ, ..., βα, ββ, ...

Uppercase Greek letter sequence generation like: OrderedListStyle.upperGreek

Α, Β, Γ, ..., ΑΑ, ΑΒ, ΑΓ, ..., ΒΑ, ΒΒ, ...

Implementation

String sequence(int index) {
  switch (this) {
    case OrderedListStyle.number:
      return '${index + 1}';
    case OrderedListStyle.lowerAlpha:
      return _alpha(index);
    case OrderedListStyle.upperAlpha:
      return _alpha(index, true);
    case OrderedListStyle.lowerRoman:
      return _roman(index + 1).toLowerCase();
    case OrderedListStyle.upperRoman:
      return _roman(index + 1);
    case OrderedListStyle.lowerGreek:
      return _greek(index);
    case OrderedListStyle.upperGreek:
      return _greek(index, true);
  }
}