getDevicesList method Null safety

Future<Map?> getDevicesList(
  1. int type
)

获取设备列表

注意:此接口只支持Mac和Windows平台

参数:

type 设备类型,指定需要获取哪种设备的列表。详见TXMediaDeviceType定义,type 只支持 TXMediaDeviceTypeMic、TXMediaDeviceTypeSpeaker、TXMediaDeviceTypeCamera。

Implementation

Future<Map?> getDevicesList(int type) async {
  if (kIsWeb) {
    List retrunList =
        jsonDecode(await _channel.invokeMethod('getDevicesList', {
      "type": type,
    }));
    Map mp = Map();
    mp["deviceList"] = retrunList;
    mp["count"] = retrunList.length;
    return Future.value(mp);
  }
  return _channel.invokeMethod('getDevicesList', {
    "type": type,
  });
}