nextKey method

String nextKey(
  1. List<String> keys,
  2. Type token
)

Determine the next key value depending on the last encountered token.

Implementation

String nextKey(List<String> keys, Type token) {
  switch (token) {
    case ListOpeningBracketToken:
      currentKey = "$currentKey.0";
      break;
    case ListClosingBracketToken:
      currentKey = currentKey.substring(0, currentKey.lastIndexOf("."));
      break;
    case ListValueSeparatorToken:
      incrementWidth;
  }

  return currentKey;
}