waitForResolveWithKey method
Implementation
Future<dynamic> waitForResolveWithKey(int key) {
return _eventController['resolve']
?.stream
.where((event) => (int.parse(event['key']) == key))
.map((event) => event['data'])
.first ??
(throw Exception("wrong event name"));
}