AgentInfo class

Public information about a support agent — either the one assigned to the active conversation, or a member of the currently-online agent pool surfaced via ChataptorClient.currentOnlineAgents.

Annotations
  • @immutable

Constructors

AgentInfo({required int id, required String name, String? avatarUrl, AgentInitials? initials})
Creates an AgentInfo.
const
AgentInfo.fromJson(Map<String, dynamic> json)
Parses a single agent entry as carried on the agent:available Phoenix event (also used in the assigned-agent payload on the conversation channel). Tolerates both int and String IDs.
factory

Properties

avatarUrl String?
URL of the agent's avatar image, if any.
final
hashCode int
The hash code for this object.
no setteroverride
id int
Server-assigned agent ID.
final
initials AgentInitials?
Fallback initials to render when avatarUrl is null or fails to load.
final
name String
Agent's display name shown to the customer.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({int? id, String? name, String? avatarUrl, AgentInitials? initials}) AgentInfo
Returns a copy with the given fields overridden.
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.
override

Static Methods

listFromPresencePayload(Map<String, dynamic> json) List<AgentInfo>
Parses the agents: list from an agent:available event payload into a typed list of AgentInfo. Skips entries that are not maps so the caller does not need to defensively unwrap the broadcast payload.