ChatPageResult<T>.fromJson constructor

ChatPageResult<T>.fromJson(
  1. Map map, {
  2. dynamic dataItemCallback = PageResultCallback,
})

Implementation

factory ChatPageResult.fromJson(Map map,
    {dataItemCallback = PageResultCallback}) {
  ChatPageResult<T> result = ChatPageResult<T>._private();
  result.._pageCount = map['count'];
  result.._data = [];

  (map['list'] as List).forEach(
    (element) => result._data.add(
      dataItemCallback(element),
    ),
  );

  return result;
}