connect static method
Create a new EventSource by connecting to the specified url.
Implementation
static Future<EventSource> connect(url,
{http.Client? client, String? lastEventId, Map? headers, String? body, String? method}) async {
// parameter initialization
url = url is Uri ? url : Uri.parse(url);
client = client ?? new http.Client();
lastEventId = lastEventId ?? "";
body = body ?? "";
method = method ?? "GET";
EventSource es = new EventSource._internal(url, client, lastEventId, headers, body, method);
await es._start();
return es;
}