- BREAKING:: Change the signature of the
webSocketHandler
method's
onConnection
callback. Previously this took an untyped function with either
one or two parameters. This now requires aConnectionCallback
; a typedef
taking two parameters. See also #457. - Add a API usage example.
- Require Dart
^3.5.0
.
Note that most clients seeing analysis issues from the above breaking change can
fix it by adding a second parameter to their callback. So, they would change
this:
webSocketHandler((webSocket) {
webSocket.stream.listen((message) {
webSocket.sink.add('echo $message');
});
});
to this:
webSocketHandler((webSocket, _) {
webSocket.stream.listen((message) {
webSocket.sink.add('echo $message');
});
});