findKeyAndvalue method

void findKeyAndvalue(
  1. dynamic varName,
  2. dynamic val,
  3. dynamic usedKeys,
  4. dynamic commonKeys,
  5. dynamic langKeys,
)

Implementation

void findKeyAndvalue(varName, val, usedKeys, commonKeys, langKeys) {
  final key = val.getField('_key').toStringValue();
  if (usedKeys.containsKey(key) == true) {
    throw Exception(
        'Duplicated key "$key" defined in "${usedKeys[key]}" and "$varName"');
  }
  usedKeys[key] = varName;
  if (val.getField('common').toBoolValue() == true) {
    commonKeys[key] = val.getField('_value').toStringValue();
  } else {
    langKeys[key] = val.getField('_value').toStringValue();
  }
}