Skip to main content
The Portal Flutter SDK exposes events emitted by the underlying native SDK as a single Dart broadcast Stream<PortalEventData>.

Overview

Portal emits events for connection state, chain changes, signing requests, dApp sessions, and more. Use these events to:
  • Drive UI for autoApprove: false flows — show approval prompts when the SDK requests a signature.
  • React to chain switches initiated by a connected dApp.
  • Track WalletConnect / Portal Connect session lifecycle.
  • Build progress and audit logging across native MPC operations.
The Flutter SDK delivers these events as a broadcast Stream on the Portal singleton:
Filter with .where(...), listen with .listen(...), await one-shot with .firstWhere(...), and stop listening by cancelling the returned StreamSubscription. Listeners are kept across Portal.initialize() calls so apps can subscribe at startup.

Subscribing to events

Listen to all events

Filter by event type

Use the PortalEvent enum to filter the stream to a single event:

One-shot (await a single event)

Multiple subscribers

Because portal.events is a broadcast stream, you can attach as many subscribers as you need without one consuming the events for the others:

Event types

portal.events delivers PortalEventData — a small wrapper that carries the raw event name, the matching PortalEvent enum value (when known), and the JSON-decoded payload from the native side.
The data field’s shape depends on the event — most events carry a Map<String, dynamic> decoded from the native JSON payload.

PortalEvent enum

If the native SDK ever dispatches an event the Flutter SDK does not yet recognize, PortalEventData.event will be null while name and data are still populated — listeners can still log or react to the raw name without breaking.
Platform availability. On Android,the only events that are currently exposed are chainChanged, portalSignatureReceived, portalSigningApproved, portalSigningRejected, and portalSigningRequested. The other app-session events are emitted on iOS only. Avoid relying on these events for cross-platform behavior until Android support lands.

Emitting events back to the native SDK

For bidirectional flows — most importantly approving or rejecting a pending signing request when autoApprove: false — use portal.emit(...):
The SDK fires PortalEvent.portalSigningRequested when user approval is needed; the host inspects the request, surfaces UI, and emits portalSigningApproved (or portalSigningRejected) to let the original signing call resolve.
data is JSON-encoded before being sent across the platform channel — pass primitives, Maps, or Lists (anything jsonEncode accepts).

End-to-end example