Debugged HTTPTransportType

master
FaizHashmiCS22 4 months ago
parent 95a92e6ccd
commit ba3a9a2d9c

@ -145,7 +145,6 @@ class AppProvider extends ChangeNotifier {
WidgetsConfigModel? currentWidgetsConfigModel; WidgetsConfigModel? currentWidgetsConfigModel;
Future<void> getInfoWidgetsConfigurationsFromServer() async { Future<void> getInfoWidgetsConfigurationsFromServer() async {
log(" errorHellpo:");
WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) { WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) {
logger.i("Api call failed with this error: ${error.toString()}"); logger.i("Api call failed with this error: ${error.toString()}");
}); });

@ -41,8 +41,6 @@ class SignalRHelper {
url, url,
HttpConnectionOptions( HttpConnectionOptions(
client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
//TODO: IT MUST BE WEB SOCKETS
transport: HttpTransportType.webSockets, transport: HttpTransportType.webSockets,
logging: (level, message) => log(message), logging: (level, message) => log(message),
)) ))
@ -57,7 +55,11 @@ class SignalRHelper {
connection!.on('addChatMessage', (message) => onUpdateAvailable(message)); connection!.on('addChatMessage', (message) => onUpdateAvailable(message));
await connection!.start(); try {
await connection!.start();
} catch (e) {
logger.i("Exception while connecting: ${e.toString()}");
}
} }
void sendMessage(List<dynamic> args) async { void sendMessage(List<dynamic> args) async {
@ -78,7 +80,6 @@ class SignalRHelper {
} }
} }
// startConnection(BuildContext context) async { // startConnection(BuildContext context) async {
// if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) { // if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) {
// connection!.off('addChatMessage'); // connection!.off('addChatMessage');

Loading…
Cancel
Save