waitForEvent method

  1. @override
Future<Map<String, dynamic>?> waitForEvent(
  1. String subscriptionId,
  2. Duration timeout
)
override

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);
}