getStreamInfo method Null safety

Future<StreamingMountPointInfo?> getStreamInfo(
  1. int id,
  2. {String? secret}
)

Get verbose info of a specific mount-point

Implementation

Future<StreamingMountPointInfo?> getStreamInfo(int id,
    {String? secret}) async {
  var payload = {
    "request": "info",
    "id": id,
    if (secret != null) "secret": secret
  };
  var response = await this.send(data: payload);
  if (response['info'] != null) {
    return StreamingMountPointInfo.fromJson(response['info']);
  }
  return null;
}