decline method Null safety

Future<void> decline(
  1. {int? code,
  2. Map<String, dynamic>? headers}
)

decline sip call code : SIP code to be sent, if not set, 486 is used; optional headers : object with key/value mappings (header name/value), to specify custom headers to add to the SIP request; optional

Implementation

Future<void> decline({
  int? code,
  Map<String, dynamic>? headers,
}) async {
  var payload = {"request": "decline", "code": code, "headers": headers}
    ..removeWhere((key, value) => value == null);
  JanusEvent response = JanusEvent.fromJson(await this.send(data: payload));
  JanusError.throwErrorFromEvent(response);
}