You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
629 B
Dart
29 lines
629 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:signalr_core/signalr_core.dart';
|
|
|
|
class SignalRHelper{
|
|
|
|
String hubBaseURL ="";
|
|
String msg ="Awaiting Patients Arrival";
|
|
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();
|
|
}
|
|
}
|
|
} |