send method Null safety

Future<void> send(
  1. dynamic command
)

Implementation

Future<void> send(command) async {
  final url = token != null ? '${_controlUrl}&token=$token' : _controlUrl;

  final ws = await WebSocket.connect(url);
  ws.listen((e) async {
    ws.add(command);
    emit('message', e);
  }, onDone: () => print('done'), onError: (err) => print('err $err'));
}