sequence method

String sequence(
  1. int index, [
  2. String style = "1"
])

Use Case:

OrderedListSequence.number.sequence(index)

Example:

Number sequence generation like: style: 1 or number

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

Lowercase alphabetic sequence generation like: style: a or lower_alpha

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

Uppercase alphabetic sequence generation like: style: A or upper_alpha

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

Lowercase Roman numeral sequence generation like: style: i or lower_roman

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

Uppercase Roman numeral sequence generation like: style: I or upper_roman

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

Lowercase Greek letter sequence generation like: style: α or lower_greek

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

Uppercase Greek letter sequence generation like: style: Α or upper_greek

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

Implementation

String sequence(
  int index, [
  String style = "1",
]) {
  final s = OrderedListStyle.from(style);
  if (s == null) return style;
  return s.sequence(index);
}