Skip to content

Commit

Permalink
moved to package:web and updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
KammererTob committed Sep 6, 2024
1 parent b11c722 commit bb46f62
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 3 additions & 2 deletions lib/src/connect_html.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -8,7 +9,7 @@ import 'stomp_config.dart';

Future<WebSocketChannel> connect(StompConfig config) {
final completer = Completer<HtmlWebSocketChannel>();
final webSocket = WebSocket(config.connectUrl)
final webSocket = web.WebSocket(config.connectUrl)
..binaryType = BinaryType.list.value;
webSocket.onOpen.first.then((value) {
completer.complete(HtmlWebSocketChannel(webSocket));
Expand Down
11 changes: 6 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions test/stomp_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit bb46f62

Please sign in to comment.