signalr_flutter
.net SignalR 클라이언트용 플러터 플러그인입니다. 이 클라이언트는 ASP.Net SignalR용이며, .Net Core SignalR용이 아닙니다.
.net SignalR 클라이언트용 플러터 플러그인입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A flutter plugin for .net SignalR client.
First of all, Initialize SignalR and connect to your server.
SignalR signalR = SignalR(
'<Your server url here>',
"<Your hub name here>",
hubMethods: ["<Your Hub Method Names>"]
statusChangeCallback: (status) => print(status),
hubCallback: (methodName, message) => print('MethodName = $methodName, Message = $message'));
signalR.connect();
Here statusChangeCallback will get called whenever connection status with server changes.
hubCallback will receive calls from the server if you subscribe to any hub method. You can do that with hubMethods.
hubMethods are the hub method names you want to subscribe.
There is a headers parameters also which takes a Map<String, String>.
You can also invoke any server method.
signalR.invokeMethod("<Your method name here>", arguments: ["argument1", "argument2"]);
If you are trying to connect with a HTTP url, then you need to add the following lines to the manifest of your android project.
<application
android:usesCleartextTraffic="true">
</application>
This is because of the Network Security Config.
R8 may strip away some SignalR classes for the Android in Release Builds. Add the following line in your proguard-rules.pro file to solve this issue.
-keep class microsoft.aspnet.signalr.client.hubs.** { *; }
For more info check example.
Any issue or PR is always welcome.
의존성 목록 4 개
{"sdk":"flutter"}{"sdk":"flutter"}^6.0.0^4.2.5사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗