asString method

String asString([
  1. int index = 0
])

Implementation

String asString([int index = 0]) {
  final i = subsequent == null ? index : index + subsequent!;

  final String suffix;
  switch (style) {
    case PdfPageLabelStyle.arabic:
      suffix = (i + 1).toString();
      break;
    case PdfPageLabelStyle.romanUpper:
      suffix = _toRoman(i + 1);
      break;
    case PdfPageLabelStyle.romanLower:
      suffix = _toRoman(i + 1).toLowerCase();
      break;
    case PdfPageLabelStyle.lettersUpper:
      suffix = _toLetters(i);
      break;
    case PdfPageLabelStyle.lettersLower:
      suffix = _toLetters(i).toLowerCase();
      break;
    case null:
      suffix = '';
  }
  return '${prefix ?? ''}$suffix';
}