EMCursorResult<T>.fromJson constructor

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

Implementation

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

  return result;
}