tabLabel method

  1. @override
String tabLabel ({int tabIndex, int tabCount })

The accessibility label used on a tab in a TabBar.

This message describes the index of the selected tab and how many tabs there are, e.g. 'Tab 1 of 2' in United States English.

tabIndex and tabCount must be greater than or equal to one.


String tabLabel({ int tabIndex, int tabCount }) {
  assert(tabIndex >= 1);
  assert(tabCount >= 1);
  final String template = tabLabelRaw;
  return template
    .replaceFirst(r'$tabIndex', formatDecimal(tabIndex))
    .replaceFirst(r'$tabCount', formatDecimal(tabCount));