toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final end = this.end;
  final eventsAfter = this.eventsAfter;
  final eventsBefore = this.eventsBefore;
  final profileInfo = this.profileInfo;
  final start = this.start;
  return {
    if (end != null) 'end': end,
    if (eventsAfter != null)
      'events_after': eventsAfter.map((v) => v.toJson()).toList(),
    if (eventsBefore != null)
      'events_before': eventsBefore.map((v) => v.toJson()).toList(),
    if (profileInfo != null)
      'profile_info': profileInfo.map((k, v) => MapEntry(k, v.toJson())),
    if (start != null) 'start': start,
  };
}