ChatCursorResult<T>.fromJson constructor

ChatCursorResult<T>.fromJson(
  1. Map<String, dynamic> map, {
  2. dynamic dataItemCallback = CursorResultCallback,
})

Implementation

factory ChatCursorResult.fromJson(Map<String, dynamic> map,
    {dataItemCallback = CursorResultCallback}) {
  List<T> list = [];
  (map['list'] as List)
      .forEach((element) => list.add(dataItemCallback(element)));
  ChatCursorResult<T> result =
      ChatCursorResult<T>._private(map['cursor'], list);

  return result;
}