editRoom method Null safety

Future editRoom(
  1. dynamic roomId,
  2. {String? secret,
  3. String? newDescription,
  4. String? newSecret,
  5. String? newPin,
  6. String? newIsPrivate,
  7. String? newRequirePvtId,
  8. String? newBitrate,
  9. String? newFirFreq,
  10. int? newPublisher,
  11. bool? newLockRecord,
  12. Map? extras,
  13. bool? permanent}
)

This allows you to modify the room description, secret, pin and whether it's private or not: you won't be able to modify other more static properties, like the room ID, the sampling rate, the extensions-related stuff and so on

Implementation

Future<dynamic> editRoom(dynamic roomId,
    {String? secret,
    String? newDescription,
    String? newSecret,
    String? newPin,
    String? newIsPrivate,
    String? newRequirePvtId,
    String? newBitrate,
    String? newFirFreq,
    int? newPublisher,
    bool? newLockRecord,
    Map? extras,
    bool? permanent}) async {
  var payload = {
    "request": "edit",
    "room": roomId,
    ...?extras,
    if (secret != null) "secret": secret,
    if (newDescription != null) "new_description": newDescription,
    if (newSecret != null) "new_secret": newSecret,
    if (newPin != null) "new_pin": newPin,
    if (newIsPrivate != null) "new_is_private": newIsPrivate,
    if (newRequirePvtId != null) "new_require_pvtid": newRequirePvtId,
    if (newBitrate != null) "new_bitrate": newBitrate,
    if (newFirFreq != null) "new_fir_freq": newFirFreq,
    if (newPublisher != null) "new_publishers": newPublisher,
    if (newLockRecord != null) "new_lock_record": newLockRecord,
    if (permanent != null) "permanent": permanent
  };
  _handleRoomIdTypeDifference(payload);
  return (await this.send(data: payload));
}