toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> json = _$PreferencesToJson(this);
// Remove empty fields from the JSON map
json.removeWhere(
(key, value) =>
value == null ||
value is String && value.isEmpty ||
value is Set && value.isEmpty,
);
return json;
}