index property

int index

Implementation

int get index {
  if (_index != null) return _index;
  if (arguments.isEmpty) return null;
  // We may have been given an all-uppercase version of the name, so compare
  // case-insensitive.
  _index = arguments
      .map((x) => x.toUpperCase())
      .toList()
      .indexOf(_variableNameUpper);
  if (_index == -1) {
    throw new ArgumentError(
        "Cannot find parameter named '$_variableNameUpper' in "
        "message named '$name'. Available "
        "parameters are $arguments");
  }
  return _index;
}