init method
Implementation
Future<void> init({
required String userId,
required String weebHookId,
}) async {
String url =
'https://webhook.botika.online/webhook/webhook_sse.php?id=$weebHookId&user=$userId';
Map<String, String> header = {
"Accept": "text/event-stream",
"Cache-Control": "no-cache",
};
SSEClient.subscribeToSSE(
method: SSERequestType.GET,
url: url,
header: header,
).listen(onData, onDone: onDone, onError: onError, cancelOnError: false);
}