Eduardo Florence

Added the allowSelfSigned parameter to GetSocket

@@ -6,5 +6,6 @@ class GetSocket extends BaseWebSocket { @@ -6,5 +6,6 @@ class GetSocket extends BaseWebSocket {
6 GetSocket( 6 GetSocket(
7 String url, { 7 String url, {
8 Duration ping = const Duration(seconds: 5), 8 Duration ping = const Duration(seconds: 5),
9 - }) : super(url, ping: ping); 9 + bool allowSelfSigned = true
  10 + }) : super(url, ping: ping, allowSelfSigned: allowSelfSigned);
10 } 11 }
@@ -18,9 +18,13 @@ class BaseWebSocket { @@ -18,9 +18,13 @@ class BaseWebSocket {
18 WebSocket socket; 18 WebSocket socket;
19 SocketNotifier socketNotifier = SocketNotifier(); 19 SocketNotifier socketNotifier = SocketNotifier();
20 bool isDisposed = false; 20 bool isDisposed = false;
21 - BaseWebSocket(this.url, {this.ping = const Duration(seconds: 5)}); 21 + BaseWebSocket(
  22 + this.url, {
  23 + this.ping = const Duration(seconds: 5),
  24 + this.allowSelfSigned = true,
  25 + });
22 Duration ping; 26 Duration ping;
23 - bool allowSelfSigned = true; 27 + bool allowSelfSigned;
24 28
25 ConnectionStatus connectionStatus; 29 ConnectionStatus connectionStatus;
26 30
1 class BaseWebSocket { 1 class BaseWebSocket {
2 String url; 2 String url;
3 Duration ping; 3 Duration ping;
4 - BaseWebSocket(this.url, {this.ping = const Duration(seconds: 5)}) { 4 + bool allowSelfSigned;
  5 + BaseWebSocket(
  6 + this.url, {
  7 + this.ping = const Duration(seconds: 5),
  8 + allowSelfSigned = true,
  9 + }) {
5 throw 'To use sockets you need dart:io or dart:html'; 10 throw 'To use sockets you need dart:io or dart:html';
6 } 11 }
7 12