renameDoc static method

String renameDoc(
  1. dynamic theItem,
  2. Map<String, String>? newDocumentIds
)

Implementation

static String renameDoc(
    dynamic theItem, Map<String, String>? newDocumentIds) {
  var documentID = theItem['documentID'];
  // potentially rename the document
  if (newDocumentIds != null) {
    var newDocumentID = newDocumentIds[documentID];
    if (newDocumentID != null) {
      theItem['documentID'] = newDocumentID;
      return newDocumentID;
    }
  }
  return documentID;
}