Provider.fromUri constructor
Provider.fromUri(
- Uri uri
Implementation
factory Provider.fromUri(Uri uri) {
if (uri.scheme == 'http' || uri.scheme == 'https') {
return HttpProvider(uri);
}
if (uri.scheme == 'ws' || uri.scheme == 'wss') {
return WsProvider(uri);
}
throw Exception('Invalid url: $uri');
}