eigen_flutter library
Reusable Flutter integration for EigenInteractive game applications.
A game app depends on this package and implements a GameModule. It can
install EigenFlutterScope beneath its own application root or use the
opinionated eigen_shell package for the complete first-party product.
import 'package:eigen_flutter/eigen_flutter.dart';
EigenFlutterScope(
module: const MyGameModule(),
config: appConfig,
child: const MaterialApp(home: MyHome()),
);
This is the supported game-facing import. It exposes the embeddable scope, configuration, game contract, wire vocabulary, and shared game UI without taking ownership of routing or a root application widget.
Start with the EigenInteractive quickstart and use the task guides for end-to-end TypeScript and Dart examples.
Classes
- AppConfig
- Whitelabel configuration for one game app built on the engine.
- AppTheme
- Minimal app theme configuration using Material 3.
- AuthGateway
- Authentication required by the Flutter presentation package.
- AuthStateChange
- A single emission of the auth state stream: what happened, and who the session user is now (null when signed out).
- AuthUser
- The signed-in user as the app sees it: the backend-agnostic twin of the auth provider's session user.
- AvatarStorageService
- Uploads the signed-in user's avatar.
- BearerTokenInterceptor
- Adds a bearer token supplied by an identity adapter to engine requests.
- Bot
- BotSeatableArgs
- A candidate bot seating, passed to GameRules.botSeatable.
- BotTag
- Compact pill that labels a participant as a bot.
- Branding
- User-facing identity for the app shell.
- BudgetConfig
- Each player has a personal time bank that drains while they act (Fischer increment).
- CommandAccepted
- Created
- DeviceRepository
- Push registrations for the authenticated user's installations.
- EigenClient
- A configured EigenInteractive backend.
- EigenFlutterScope
- Installs Eigen's reusable Flutter state beneath an application-owned root.
- EngineConfig
- Runtime configuration the framework needs to talk to its backends.
- Frame
- Friend
- FriendRequest
- GameContentContext
- Everything GameRules.buildContent needs, bundled into one object.
- GameCreationSpec
- Declarative description of what is valid when creating a game of this type.
- GameFrame
- A single observation snapshot of an active or finished game.
- GameModule
- Contract every game implementor provides.
- GamePlayer
- Unified game-level player concept.
- GameRepository
- Everything a client does to a game: discovery, the waiting room, moves, and the live frame feed.
-
GameRules<
TObs, TAction, TConfig> -
The client-side surface of one
schemaVersionof the game: the Dart twin of the same-named TSGameRulesunit. - GameSession
- One game's live session, as the client holds it: the newest snapshot the server stated, plus the frame being rendered and the one it replaced.
- GameSocket
- Opens a game's socket and keeps it open for the screen's lifetime.
- GameSummary
- GameTransition
- The step from one frame to the next: the unit a game animates.
- GuestTag
- Compact pill that labels a player as an anonymous guest.
- HttpDate
- Parses the RFC 1123 dates HTTP uses.
- MySeat
- A sealed union of the two ways the current user relates to a game.
- Outcome
- PerActionConfig
- Each turn gets a fresh fixed window of minSeconds–maxSeconds.
- Player
- PlayerAvatar
- Circular avatar for a player, with customizable size.
- PlayerBatchLoader
- Coalesces single-id player lookups into one batch request per frame.
- PlayerLimits
- The seats one config may be played with, returned by GameRules.playerLimits.
- PlayerRepository
- Fetches public player identities, humans and bots alike.
- PlayersContext
- Player identity data passed to GameRules.buildContent.
- PlayerTimerBuilder
- Headless widget that computes a single player's remaining budget time, exposing it to a builder callback every second.
- Profile
- ProfileRepository
- The signed-in user's own profile.
- Rating
- RatingDelta
- RatingHistoryEntry
- RatingIdentity
- RatingPoolArgs
- The chosen game settings, passed to GameRules.ratingPool.
- RatingRepository
- Player ratings and the caller's own rating log.
- Seat
- Seated
- The current user holds seat index in the game (a participant).
- ServerClock
- Server time, as best the client can tell.
- Session
- SocialRepository
- The friend graph: friends, pending requests, blocks, and user search.
- SoloStarted
- TimingContext
- Timing data passed to GameRules.buildContent for every active game.
- TimingModeConfig
- Configuration for one timing option shown in the new-game dialog.
- TurnTimerBuilder
-
Headless widget that ticks toward a deadline, exposing the remaining
Durationto a builder callback every second. - Authentication boundary used when an app has not installed an adapter.
- UntimedConfig
- No time limit. Players act at any pace. No additional controls rendered.
- Viewer
- The current user has no seat: a non-participant viewing a replay.
Enums
- ActionSubmitResult
- How a submitted action resolved, reported to the game through the future returned by GameContentContext.onAction.
- AuthEvent
- Auth lifecycle events surfaced by the authentication state stream.
- AuthUpgradeResult
- Result of trying to turn a guest session into a Google-backed account.
- DevicePlatform
- Push-delivery platforms understood by the engine.
- ErrorCode
- A stable machine code identifying why a request failed.
- FrameTypeEnum
- FriendRequestDirectionEnum
- FriendRequestResultStatusEnum
- GameAccess
- GameStatus
- OutcomeResultEnum
- SeatTypeEnum
Extensions
- AuthStateChangePatterns on AuthStateChange
- Adds pattern-matching-related methods to AuthStateChange.
- AuthUserPatterns on AuthUser
- Adds pattern-matching-related methods to AuthUser.
Constants
- activeGamesBucket → const String
- Games still playable - the home screen's list.
- finishedGamesBucket → const String
- Games that have ended - the history list.
- historyPageSize → const int
- Number of games fetched per history page.
- kMaxBudgetSeconds → const int
- Infra hard maximum for budget (accumulated) clock (10 days).
- kMaxTurnSeconds → const int
- Infra hard maximum for per-action turn time (30 days).
- kMinBudgetSeconds → const int
- Infra hard minimum for budget (accumulated) clock (seconds).
- kMinTurnSeconds → const int
- Infra hard minimum for per-action turn time (seconds).
- lobbyPageSize → const int
- Number of games fetched per lobby page.
- profileGamesPageSize → const int
- Number of games shown in the replay list on a player's profile.
Properties
- appConfigProvider → AppConfigProvider
-
The active AppConfig.
final
- currentGameModuleProvider → CurrentGameModuleProvider
-
The active GameModule.
final
Functions
-
buildGameSocketUri(
{required String apiBaseUrl, required String gameId, required String ticket}) → Uri - Builds the browser-compatible authenticated socket URI.
-
engineCall<
T> (Future< T> run()) → Future<T> - Runs a generated API call, rethrowing a server-reported failure as the domain EngineException so nothing above the data layer handles Dio types.
-
engineData<
T> (Future< Response< run()) → Future<T> >T> -
Runs a generated API call and returns its decoded body, unwrapping the
Response. -
resolveAvatarUrl(
String? avatarUrl, String apiBaseUrl) → String? -
Resolves a stored
avatarUrlinto something an image widget can load.
Typedefs
-
AccessTokenProvider
= Future<
String?> Function() - Obtains the current access token for one engine request.
- GameSocketEvent = Session
- The socket carries exactly one message: the complete live truth about the game as this seat sees it.
-
GamesPage
= ({List<
GameSummary> games, String? nextCursor}) - One page of a paged game list, plus the token that continues it.
Exceptions / Errors
- EngineException
-
A failure the engine server itself reported: a non-2xx response carrying
the
{ error, code? }envelope. - PlayerNotFoundException
- Thrown when a player lookup matches no row.
- UnsupportedGameSchemaException
-
Thrown when a game's
games.schema_versionhas no entry in GameModule.versions. It was created by a newer app version and can't be loaded until the user updates.