toJson method

Map<String, Object?> toJson()

Encodes this value as a JSON object.

Implementation

Map<String, Object?> toJson() => <String, Object?>{
  if (cursor != null) 'cursor': cursor!,
  if (direction != null) 'direction': direction!.toJson(),
  if (limit != null) 'limit': limit!,
  if (levels.isNotEmpty)
    'levels': levels.map((item) => item.toJson()).toList(growable: false),
  if (categories.isNotEmpty)
    'categories': categories.map((item) => item).toList(growable: false),
  if (since != null) 'since': since!,
  if (until != null) 'until': until!,
  if (ttlMs != null) 'ttlMs': ttlMs!,
};