How to use SignalR on Flutter?

2020-06-12 05:02发布

问题:

Hi guys I'm trying to communicate with an Asp.Net core 2.1 application that uses SignalR to establish its chat communications, but I can't figure out what's the best way to accomplish that using flutter.

I've searched for some library to do that, but the one that I found was not compatible with Flutter, just with Dart web as it uses the original SignalR.js to wrap the methods.

Do you guys have any tips on how to accomplish that task ?

回答1:

I just created a Flutter client for SignalR (ASP.NET Core). You can find it at Pub



回答2:

If flutter plugins are not available for Signalr, you can always use native libraries available for signalr and use flutter's platform channels to use those native features in your flutter code.

Here are some helpful resource that might help

How to use signalr in Android?

https://github.com/Gurgen/SignalR-.net-core-android-client

Flutter platform channels