add the basic single R
parent
c646861185
commit
4ba94f86f6
@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:signalr_core/signalr_core.dart';
|
||||
|
||||
class SignalRHelper{
|
||||
|
||||
String hubBaseURL ="";
|
||||
String msg ="Elham";
|
||||
HubConnection connection;
|
||||
SignalRHelper(){
|
||||
connection = HubConnectionBuilder()
|
||||
.withUrl(
|
||||
hubBaseURL,
|
||||
HttpConnectionOptions(
|
||||
logging: (level, message) {
|
||||
msg = message;
|
||||
print("$message");
|
||||
},
|
||||
)
|
||||
).build();
|
||||
}
|
||||
|
||||
|
||||
closeConnection(BuildContext context) async {
|
||||
if(connection.state == HubConnectionState.connected)
|
||||
{
|
||||
await connection.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue