toJson method

Map<String, dynamic> toJson()

Serialises this DTO to JSON, stripping null entries so the VM-side handler (which coerces to Map<String, String>) doesn't choke.

Implementation

Map<String, dynamic> toJson() {
  final json = _$SortRequestDtoToJson(this);
  json.removeWhere((_, value) => value == null);
  return json;
}