buildServerAddress function
Implementation
Uri buildServerAddress(Uri uri, bool secure, {bool webSockets = true}) {
if (uri.scheme.isEmpty) {
uri =
uri.replace(scheme: (webSockets ? 'ws' : 'http') + (secure ? 's' : ''));
}
if (!uri.hasPort) {
uri = uri.replace(port: kDefaultPort);
}
return uri;
}