fromMap static method

ChatMediumEntity? fromMap(
  1. Object? o, {
  2. Map<String, String>? newDocumentIds,
})

Implementation

static ChatMediumEntity? fromMap(Object? o,
    {Map<String, String>? newDocumentIds}) {
  if (o == null) return null;
  var map = o as Map<String, dynamic>;

  var memberMediumIdNewDocmentId = map['memberMediumId'];
  if ((newDocumentIds != null) && (memberMediumIdNewDocmentId != null)) {
    var memberMediumIdOldDocmentId = memberMediumIdNewDocmentId;
    memberMediumIdNewDocmentId = newRandomKey();
    newDocumentIds[memberMediumIdOldDocmentId] = memberMediumIdNewDocmentId;
  }
  return ChatMediumEntity(
    memberMediumId: memberMediumIdNewDocmentId,
  );
}