hangup method Null safety

Future<void> hangup(
  1. {Map<String, dynamic>? headers}
)
override

hangup the call headers: object with key/value mappings (header name/value), to specify custom headers to add to the SIP BYE; optional

Implementation

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