Jonatas

fix allowSelfSigned on flutter_web

... ... @@ -19,8 +19,13 @@ class BaseWebSocket {
SocketNotifier socketNotifier = SocketNotifier();
Duration ping;
bool isDisposed = false;
bool allowSelfSigned;
BaseWebSocket(this.url, {this.ping = const Duration(seconds: 5)}) {
BaseWebSocket(
this.url, {
this.ping = const Duration(seconds: 5),
this.allowSelfSigned = true,
}) {
url = url.startsWith('https')
? url.replaceAll('https:', 'wss:')
: url.replaceAll('http:', 'ws:');
... ...
... ... @@ -7,7 +7,7 @@ class BaseWebSocket {
BaseWebSocket(
this.url, {
this.ping = const Duration(seconds: 5),
allowSelfSigned = true,
this.allowSelfSigned = true,
}) {
throw 'To use sockets you need dart:io or dart:html';
}
... ...