From 1f34c30ff951c69ecf0df2f62868a44480f864ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Thu, 30 Nov 2023 09:46:41 +0100 Subject: [PATCH] Fix JS value to Dart conversion when receiving from a web socket --- lib/html.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/html.dart b/lib/html.dart index 82edd2d..c7dbbf8 100644 --- a/lib/html.dart +++ b/lib/html.dart @@ -127,13 +127,13 @@ class HtmlWebSocketChannel extends StreamChannelMixin } void _innerListen(MessageEvent event) { - final eventData = event.data; + final JSAny? eventData = event.data; Object? data; if (eventData.typeofEquals('object') && (eventData as JSObject).instanceOfString('ArrayBuffer')) { data = (eventData as JSArrayBuffer).toDart.asUint8List(); } else { - data = event.data; + data = event.data.dartify(); } _controller.local.sink.add(data); }