waitForEvent method
Implementation
@override
Future<Map<String, dynamic>?> waitForEvent(String subscriptionId, Duration timeout) async {
final res = await _methodChannel.invokeMethod<String>(
'waitForEvent',
{
"subscriptionId": subscriptionId,
"timeout": jsonEncode(timeout.inMilliseconds)
}
);
if (res == null) throw AssertionError("received null result from platform method waitForEvent");
return jsonDecode(res);
}