currentUserIdUpdates property

  1. @override
Stream<String?> get currentUserIdUpdates
override

Stream of the currently-identified user id. Emits null on logout / before identify. Mirrors Android SDK's StateFlow<String?> and the iOS plugin's shadowed cache (Kit currentUserId is internal).

Implementation

@override
Stream<String?> get currentUserIdUpdates {
  // The wire emits `null` on logout (Android: StateFlow<String?>; iOS:
  // shadowed cache pushed at identify/logout sites). Use a broadcast
  // stream as-is — Dart sees the `null` value verbatim.
  _currentUserIdUpdatesStream ??= currentUserIdEventChannel
      .receiveBroadcastStream()
      .map((event) => event as String?);
  return _currentUserIdUpdatesStream!;
}