replaceKey method

void replaceKey(
  1. String newKey,
  2. String oldKey
)

使用新的key替换旧的key,value保持不变

Implementation

void replaceKey(String newKey, String oldKey) {
  final value = _data[oldKey];
  if (value == null) {
    return;
  }

  _data[newKey] = value;
  _data.remove(oldKey);
}