diff --git a/CHANGELOG.md b/CHANGELOG.md index f826141..f76d435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.0 + - Updated version of `web_socket_channel` dependency to 3.0.1 + - Moved from `dart:html` to `package:web` for [web interop](https://dart.dev/interop/js-interop/package-web#migrating-from-dart-html) + ## 2.0.0 - **Breaking**: Changed exports to be all reexported in a single file to import. This is to satisfy the dart/flutter [conventions](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#structure). Thanks @Peetee06 diff --git a/lib/src/connect_html.dart b/lib/src/connect_html.dart index 41f3316..0259e99 100644 --- a/lib/src/connect_html.dart +++ b/lib/src/connect_html.dart @@ -1,5 +1,6 @@ import 'dart:async'; -import 'dart:html'; + +import 'package:web/web.dart' as web; import 'package:web_socket_channel/html.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; @@ -8,7 +9,7 @@ import 'stomp_config.dart'; Future connect(StompConfig config) { final completer = Completer(); - final webSocket = WebSocket(config.connectUrl) + final webSocket = web.WebSocket(config.connectUrl) ..binaryType = BinaryType.list.value; webSocket.onOpen.first.then((value) { completer.complete(HtmlWebSocketChannel(webSocket)); diff --git a/pubspec.yaml b/pubspec.yaml index a7905b9..de37f5a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,14 +1,15 @@ name: stomp_dart_client homepage: https://github.com/blackhorse-one/stomp_dart -version: 2.0.0 +version: 2.1.0 description: Dart STOMP client for easy messaging interoperability. Build with flutter in mind, but should work for every dart application. environment: sdk: ">=2.12.0 <4.0.0" dependencies: - web_socket_channel: ^2.4.0 + web: ^1.0.0 + web_socket_channel: ^3.0.1 dev_dependencies: - test: ^1.25.0 - lints: ^3.0.0 - stream_channel: ^2.1.1 + test: ^1.25.8 + lints: ^4.0.0 + stream_channel: ^2.1.2 diff --git a/test/stomp_test.dart b/test/stomp_test.dart index 00afd8e..78ae2af 100644 --- a/test/stomp_test.dart +++ b/test/stomp_test.dart @@ -272,8 +272,8 @@ void main() { late StompClient client; late StompUnsubscribe stompUnsubscribe; - final onError = expectAsync1((dynamic _) { - print(_); + final onError = expectAsync1((dynamic res) { + print(res); }, count: 0); final onConnect = expectAsync1( (StompFrame frame) {