GlobalState class

Shared state synchronized across all clients and the server, providing access to connected clients, registered functions, active media streams, and session metadata

Constructors

GlobalState({Map<int, Context> clients = const {}, Map<int, List<ActionFunctionRegister>> functions = const {}, Map<String, UIStreamState> uIStreams = const {}, Map<String, AudioStreamState> audioStreams = const {}, Map<String, VideoStreamState> videoStreams = const {}, String spaceId = '', String ikonServerId = '', String appSessionId = '', String sessionIdentityHash = '', String spaceUrl = '', String sessionUrl = '', String firstUserId = '', String primaryUserId = '', String organisationName = '', String spaceName = '', ServerRunType serverRunType = ServerRunType.local, bool publicAccess = false, bool debugMode = false})
GlobalState.fromJson(Map<String, dynamic> json)
factory
GlobalState.fromReader(TeleportObjectReader reader)
factory
GlobalState.fromTeleport(Uint8List data)
factory

Properties

appSessionId String
Unique identifier of the app session this server is serving — the session's business identity, stable across the servers that run it. Empty outside a cloud run.
getter/setter pair
audioStreams Map<String, AudioStreamState>
Active audio streams indexed by stream ID
getter/setter pair
clients Map<int, Context>
All connected clients indexed by their client session ID, containing client metadata such as user ID, device info, viewport dimensions, and locale
getter/setter pair
debugMode bool
Whether debug mode is enabled, providing additional logging and development features
getter/setter pair
firstUserId String
User ID of the first human user who joined this session, dynamically reassigned when that user leaves
getter/setter pair
functions Map<int, List<ActionFunctionRegister>>
Registry of callable functions organized by client session ID
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
ikonServerId String
Unique identifier of the specific Ikon server instance handling this session
getter/setter pair
organisationName String
Display name of the organization
getter/setter pair
primaryUserId String
Static user ID of the session owner from server configuration, used for user-specific asset storage paths
getter/setter pair
publicAccess bool
Tells whether the app is being run through publicly accessible endpoints (in local development)
getter/setter pair
retiredFields GlobalStateRetiredFields?
Retired ledger values captured on read: keys the schema no longer names, kept so code upgrading from an older peer can still reach them. Null when the source carried none.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serverRunType ServerRunType
Tells where the server is running from
getter/setter pair
sessionIdentityHash String
Hash of the session identity values that this session was joined on
getter/setter pair
sessionUrl String
Full URL with session identifier for direct access to current session
getter/setter pair
spaceId String
Unique identifier for the space where this session is running
getter/setter pair
spaceName String
Display name of the space
getter/setter pair
spaceUrl String
URL for accessing the app through its space domain
getter/setter pair
uIStreams Map<String, UIStreamState>
Active UI streams indexed by stream ID
getter/setter pair
videoStreams Map<String, VideoStreamState>
Active video streams indexed by stream ID
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toProtocolMessage(int senderId, {ProtocolMessageOverrides? overrides}) ProtocolMessage
toString() String
A string representation of this object.
inherited
toTeleport() Uint8List
writeTo(TeleportObjectWriter scope) → void

Operators

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