Jonatas

fix allowSelfSigned on flutter_web

@@ -19,8 +19,13 @@ class BaseWebSocket { @@ -19,8 +19,13 @@ class BaseWebSocket {
19 SocketNotifier socketNotifier = SocketNotifier(); 19 SocketNotifier socketNotifier = SocketNotifier();
20 Duration ping; 20 Duration ping;
21 bool isDisposed = false; 21 bool isDisposed = false;
  22 + bool allowSelfSigned;
22 23
23 - BaseWebSocket(this.url, {this.ping = const Duration(seconds: 5)}) { 24 + BaseWebSocket(
  25 + this.url, {
  26 + this.ping = const Duration(seconds: 5),
  27 + this.allowSelfSigned = true,
  28 + }) {
24 url = url.startsWith('https') 29 url = url.startsWith('https')
25 ? url.replaceAll('https:', 'wss:') 30 ? url.replaceAll('https:', 'wss:')
26 : url.replaceAll('http:', 'ws:'); 31 : url.replaceAll('http:', 'ws:');
@@ -7,7 +7,7 @@ class BaseWebSocket { @@ -7,7 +7,7 @@ class BaseWebSocket {
7 BaseWebSocket( 7 BaseWebSocket(
8 this.url, { 8 this.url, {
9 this.ping = const Duration(seconds: 5), 9 this.ping = const Duration(seconds: 5),
10 - allowSelfSigned = true, 10 + this.allowSelfSigned = true,
11 }) { 11 }) {
12 throw 'To use sockets you need dart:io or dart:html'; 12 throw 'To use sockets you need dart:io or dart:html';
13 } 13 }