PullResult.fromJson constructor

PullResult.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory PullResult.fromJson(Map<String, Object?> json) => json['resync_required'] == true
    ? const ResyncRequired()
    : PullPage(
        items: [
          for (final i in (json['items']! as List<Object?>).cast<Map<String, Object?>>())
            PullItem.fromJson(i),
        ],
        cursor: (json['cursor']! as num).toInt(),
        hasMore: json['has_more']! as bool,
        deviceSeq: (json['device_seq'] as num?)?.toInt(),
      );