start method
Implementation
@override
Future<bool> start({bool refresh = false, String? key}) async {
bool ok = true;
busy = true;
try {
var uri = URI.parse(url!);
connected = false;
if (uri != null) {
channel = SseChannel.connect(uri,
headers: headers,
body: body,
method: method,
events: events?.split(","));
channel.stream.listen(_onData, onError: _onError, onDone: _onDone);
connected = true;
}
} catch (e) {
connected = false;
Log().error('Error Connecting to $url. Error is $e', caller: 'SseModel');
}
busy = false;
return ok;
}