Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
package_shelf_web_socket v3.0.0 source code.tar.gz | 2025-01-21 | 115.4 kB | |
package_shelf_web_socket v3.0.0 source code.zip | 2025-01-21 | 195.8 kB | |
README.md | 2025-01-21 | 871 Bytes | |
Totals: 3 Items | 312.0 kB | 0 |
- BREAKING:: Change the signature of the
webSocketHandler
method'sonConnection
callback. 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:
:::dart
webSocketHandler((webSocket) {
webSocket.stream.listen((message) {
webSocket.sink.add('echo $message');
});
});
to this:
:::dart
webSocketHandler((webSocket, _) {
webSocket.stream.listen((message) {
webSocket.sink.add('echo $message');
});
});