New
package:shelf_web_socket v3.0.0
- BREAKING:: Change the signature of the
webSocketHandlermethod'sonConnectioncallback. Previously this took an untyped function with either one or two parameters. This now requires aConnectionCallback; a typedef taking two parameters. See also https://github.com/dart-lang/shelf/issues/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');
});
});