rename method

bool rename(
  1. String id,
  2. String id2
)

Changes id to id2.

Implementation

bool rename(String id, String id2) {
  if (id == id2) return false;

  if (isEmptyString(id) || isEmptyString(id2)) return false;

  var prev = _assets.remove(id);
  if (prev != null) {
    _assets[id2] = prev;
    return true;
  }
  return false;
}