waitForEvent method

Future<EntitySubscriptionEvent<T>?> waitForEvent(
  1. Duration timeout
)

Implementation

Future<EntitySubscriptionEvent<T>?> waitForEvent(Duration timeout) async {
  final eventJson = await CardinalSdkPlatformInterface.instance
      .subscription
      .waitForEvent(_instanceId, timeout);
  if (eventJson != null) {
    return EntitySubscriptionEvent.fromJSON(eventJson, _decodeT);
  } else {
    return null;
  }
}