StaticIdentityProvider class

A ChatIdentityProvider that always returns the same user ID.

Useful for tests and example apps where a fixed identity is sufficient.

final chat = await Chat.create(
  databasePath: ':memory:',
  adapter: MockChatAdapter(),
  identityProvider: StaticIdentityProvider('user-1'),
);
Implemented types

Constructors

StaticIdentityProvider(String _userId)
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userIdChanges Stream<String?>
Emits whenever the current user id changes.
no setteroverride

Methods

getCurrentUserId() Future<String?>
Returns the current user id, or null when the app is unauthenticated.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited