From bbfce406718f751c3eea07c1f015b522493af614 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 28 Aug 2024 10:14:46 -0700 Subject: [PATCH] Add a reference to AdapterWebSocketChannel for WebSocketChannel users (#1297) --- pkgs/cupertino_http/CHANGELOG.md | 2 ++ pkgs/cupertino_http/lib/src/cupertino_web_socket.dart | 10 ++++++++-- pkgs/cupertino_http/pubspec.yaml | 2 +- pkgs/ok_http/lib/src/ok_http_web_socket.dart | 9 +++++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index 4cd4a5e8cd..4667f6ab1f 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.5.2-wip + ## 1.5.1 * Allow `1000` as a `code` argument in `CupertinoWebSocket.close`. diff --git a/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart b/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart index b374dd9907..dc4d748c14 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart @@ -23,8 +23,9 @@ class ConnectionException extends WebSocketException { /// A [WebSocket] implemented using the /// [NSURLSessionWebSocketTask API](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask). /// -/// NOTE: the [WebSocket] interface is currently experimental and may change in -/// the future. +/// > [!NOTE] +/// > The [WebSocket] interface is currently experimental and may change in the +/// > future. /// /// ```dart /// import 'package:cupertino_http/cupertino_http.dart'; @@ -47,6 +48,11 @@ class ConnectionException extends WebSocketException { /// }); /// } /// ``` +/// +/// > [!TIP] +/// > [`AdapterWebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/adapter_web_socket_channel/AdapterWebSocketChannel-class.html) +/// > can be used to adapt a [CupertinoWebSocket] into a +/// > [`WebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel-class.html). class CupertinoWebSocket implements WebSocket { /// Create a new WebSocket connection using the /// [NSURLSessionWebSocketTask API](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask). diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index 94a9da8d8c..6516790d10 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cupertino_http -version: 1.5.1 +version: 1.5.2-wip description: >- A macOS/iOS Flutter plugin that provides access to the Foundation URL Loading System. diff --git a/pkgs/ok_http/lib/src/ok_http_web_socket.dart b/pkgs/ok_http/lib/src/ok_http_web_socket.dart index 4136a62852..16ed95ed1a 100644 --- a/pkgs/ok_http/lib/src/ok_http_web_socket.dart +++ b/pkgs/ok_http/lib/src/ok_http_web_socket.dart @@ -15,6 +15,10 @@ import 'jni/bindings.dart' as bindings; /// [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) /// API. /// +/// > [!NOTE] +/// > The [WebSocket] interface is currently experimental and may change in the +/// > future. +/// /// Example usage of [OkHttpWebSocket]: /// ```dart /// import 'package:ok_http/ok_http.dart'; @@ -37,6 +41,11 @@ import 'jni/bindings.dart' as bindings; /// }); /// } /// ``` +/// +/// > [!TIP] +/// > [`AdapterWebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/adapter_web_socket_channel/AdapterWebSocketChannel-class.html) +/// > can be used to adapt a [OkHttpWebSocket] into a +/// > [`WebSocketChannel`](https://pub.dev/documentation/web_socket_channel/latest/web_socket_channel/WebSocketChannel-class.html). class OkHttpWebSocket implements WebSocket { late bindings.OkHttpClient _client; late final bindings.WebSocket _webSocket;