Map<String, dynamic> toJson() { final json = <String, dynamic>{}; if (key != null) { json[r'key'] = key; } if (value != null) { json[r'value'] = value; } return json; }