Map<String, dynamic> toJson() { final begin = this.begin; final end = this.end; return { 'Begin': begin, if (end != null) 'End': end, }; }