toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
// Always include encodedTrack if it was explicitly set (even if null for stopping)
if (_includeEncodedTrack) {
json['encodedTrack'] = encodedTrack;
}
if (position != null) {
json['position'] = position;
}
if (endTime != null) {
json['endTime'] = endTime;
}
if (volume != null) {
json['volume'] = volume;
}
if (paused != null) {
json['paused'] = paused;
}
if (filters != null) {
json['filters'] = filters;
}
if (voice != null) {
json['voice'] = voice!.toJson();
}
return json;
}