mapToQBMessageCounter static method

QBMessagesCounter? mapToQBMessageCounter(
  1. Map<String, Object>? map
)

Implementation

static QBMessagesCounter? mapToQBMessageCounter(Map<String, Object>? map) {
  if (map == null || map.isEmpty) {
    return null;
  }

  QBMessagesCounter counter = QBMessagesCounter();

  if (map.containsKey("totalCount")) {
    counter.total = map["totalCount"] as int?;
  }

  if (map.containsKey("dialogsCount")) {
    List<Object?>? listObjects = map["dialogsCount"] as List<Object?>?;
    counter.dialogs = listObjectToListDialogsCount(listObjects);
  }

  return counter;
}