The default values within the ConnectivityUtils are getting overridden with NULL if initialize is called without values passed through. Also they will get overridden if instance is called and no instance exists.
If not it forces the user to call the following all the time
ConnectivityUtils.initialize(serverToPing: "http://www.gstatic.com/generate_204", callback: (_) => true);
19 Pull Request Sent
The default values within the ConnectivityUtils are getting overridden with NULL if initialize is called without values passed through. Also they will get overridden if instance is called and no instance exists.
` String _serverToPing = "http://www.gstatic.com/generate_204"; VerifyResponseCallback callback = () => true;
... static ConnectivityUtils initialize({String serverToPing, VerifyResponseCallback callback}) { instance = ConnectivityUtils.(serverToPing : serverToPing, callback : callback); return _instance; }
static ConnectivityUtils get instance { if (_instance == null) { instance = ConnectivityUtils.(); } return _instance; }
ConnectivityUtils._({String serverToPing, VerifyResponseCallback callback}) { // Change these two lines from: this._serverToPing = serverToPing; this._callback = callback; // TO: this._serverToPing = serverToPing != null ? serverToPing : this._serverToPing; this._callback = callback!= null ? callback: this._callback ; `
If not it forces the user to call the following all the time
ConnectivityUtils.initialize(serverToPing: "http://www.gstatic.com/generate_204", callback: (_) => true);