SignalR class

A .Net SignalR Client for Flutter.

Constructors

SignalR(String baseUrl, String hubName, {String? queryString, Map<String, String>? headers, List<String>? hubMethods, Transport transport = Transport.Auto, dynamic statusChangeCallback(dynamic)?, dynamic hubCallback(String?, dynamic)?})

Properties

baseUrl String
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>?
final
hubCallback → (dynamic Function(String?, dynamic)?)
This callback gets called whenever SignalR server sends some message to client.
final
hubMethods List<String>?
List of Hub method names you want to subscribe. Every subsequent message from server gets called on hubCallback.
final
hubName String
final
isConnected Future<bool?>
no setter
queryString String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusChangeCallback → (dynamic Function(dynamic)?)
This callback gets called whenever SignalR connection status with server changes.
final
transport Transport
Transport.Auto is default.
final

Methods

connect() Future<bool?>
Connect to the SignalR Server with given baseUrl & hubName.
invokeMethod<T>(String methodName, {List? arguments}) Future<T?>
Invoke any server method with optional arguments.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reconnect() → void
Try to Reconnect SignalR connection if it gets disconnected.
stop() → void
Stop SignalR connection
subscribeToHubMethod(String methodName) → void
Subscribe to a Hub method. Every subsequent message from server gets called on hubCallback.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

CONNECTION_STATUS → const String
NEW_MESSAGE → const String