toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final count = this.count;
  final groups = this.groups;
  final highlights = this.highlights;
  final nextBatch = this.nextBatch;
  final results = this.results;
  final state = this.state;
  return {
    if (count != null) 'count': count,
    if (groups != null)
      'groups': groups.map(
        (k, v) => MapEntry(k, v.map((k, v) => MapEntry(k, v.toJson()))),
      ),
    if (highlights != null) 'highlights': highlights.map((v) => v).toList(),
    if (nextBatch != null) 'next_batch': nextBatch,
    if (results != null) 'results': results.map((v) => v.toJson()).toList(),
    if (state != null)
      'state':
          state.map((k, v) => MapEntry(k, v.map((v) => v.toJson()).toList())),
  };
}