scanTcpDevice method Null safety

  1. @override
Future<List<TcpDevice>?> scanTcpDevice()
override

扫描网络TCP设备

Implementation

@override
Future<List<TcpDevice>?> scanTcpDevice() async {
  return methodChannel
      .invokeMethod(PluginConstants.methodScanTcpDevice)
      .then((value) {
    return proto.TcpDeviceList.fromBuffer(value)
        .items
        .map((e) => TcpDevice.fromProto(e))
        .toList();
  });
}