CoGuestState class abstract

Co-guest related state data provided externally by CoGuestStore

A comprehensive snapshot of the current co-guest session state. This structure contains all relevant information about connected users, pending invitations and applications.

Note: State is automatically updated when users join/leave seats, send/cancel invitations, or apply/cancel applications. Subscribe to coGuestState to receive real-time updates.

Usage Example

// Define listeners
late final VoidCallback connectedListener = _onConnectedChanged;
late final VoidCallback applicantsListener = _onApplicantsChanged;
late final VoidCallback inviteesListener = _onInviteesChanged;

void _onConnectedChanged() {
    updateConnectedUsersUI(store.coGuestState.connected.value);
}

void _onApplicantsChanged() {
    final applicants = store.coGuestState.applicants.value;
    if (applicants.isNotEmpty) {
        showApplicationsBadge(applicants.length);
    }
}

void _onInviteesChanged() {
    final invitees = store.coGuestState.invitees.value;
    if (invitees.isNotEmpty) {
        showInvitationsPendingUI(invitees);
    }
}

// Subscribe to state changes
store.coGuestState.connected.addListener(connectedListener);
store.coGuestState.applicants.addListener(applicantsListener);
store.coGuestState.invitees.addListener(inviteesListener);

State Properties Overview

Property Type Role Description
connected ValueListenable<List<SeatUserInfo>> Both List of users currently on seats
invitees ValueListenable<List<LiveUserInfo>> Host Users invited by host (waiting for response)
applicants ValueListenable<List<LiveUserInfo>> Host Users who applied (waiting for host decision)
candidates ValueListenable<List<LiveUserInfo>> Host List of potential users available for invitation

Constructors

CoGuestState()

Properties

applicants ValueListenable<List<LiveUserInfo>>
List of users who applied for co-guest received by host.
no setter
candidates ValueListenable<List<LiveUserInfo>>
List of candidate users for co-guest.
no setter
connected ValueListenable<List<SeatUserInfo>>
List of users already on seats.
no setter
hashCode int
The hash code for this object.
no setterinherited
invitees ValueListenable<List<LiveUserInfo>>
List of users invited by host.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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