Skip to main content

Dart API

Game modules use one package and one import:

import 'package:eigen_flutter/eigen_flutter.dart';

Open the latest eigen_flutter API reference on pub.dev →

The standard app composition root imports the complete shell and optional Firebase adapter:

import 'package:eigen_shell/eigen_shell.dart';
import 'package:eigen_firebase/eigen_firebase.dart';

Open the latest eigen_shell API reference on pub.dev →

Open the latest eigen_firebase API reference on pub.dev →

The public package surfaces are:

LibraryUse it for
package:eigen_flutter/eigen_flutter.dartEmbeddable scope, configuration, the Dart GameModule / GameRules contract, domain vocabulary, and game-facing widgets.
package:eigen_flutter/testing/twin_fixtures.dartRunning the shared TypeScript/Dart contract fixtures from flutter test.
package:eigen_flutter/adapters.dartSupported provider ports used by integration packages, not ordinary game code.
package:eigen_shell/eigen_shell.dartThe standard application startup, routing, and complete first-party product.
package:eigen_firebase/eigen_firebase.dartFirebase initialization, provider overrides, explicit telemetry policy, and background-message types.

Everything under the package's core/, features/, and shared/ directories is implementation detail. Do not deep-import it. If a task guide asks you to use a type that is missing from the barrel, that is an engine API bug.

Offline play

The Dart local unit surfaces through the same package a game already imports; there is no new dependency to add.

  • GameRules.local, in package:eigen_flutter/eigen_flutter.dart, returns a version's optional LocalGameRules unit, or null for a version that ships no on-device bots.
  • eigen_codegen:generate_payloads additionally emits a <Game>V<N>State payload type and a <Game>V<N>LocalRulesBase implementing the seven codecs LocalGameRules needs, so a game supplies only its four hooks and botActions.
  • package:eigen_client — the pure-Dart runtime eigen_flutter embeds — carries the local kernel and engine directly: LocalGameRules, EigenRng, LocalGameRecord, LocalGameStore, BotRunner, and LocalGameEngine. Game code never imports this package; the Flutter adapter wires it up.

See Offline play for how to implement one.

Guide versus API reference

Use this site to complete a task; use pub.dev to look up an exact constructor, member, or type:

  • The contract explains what you implement on both the TypeScript and Dart sides.
  • Rendering covers GameContentContext, actions, optimistic preview, seats, and widget tests.
  • Creation UI covers GameCreationSpec and the version-independent module UI.
  • Monetization covers CommerceRepository, PurchaseGateway and HostedStorefront, offers, entitlements, access, and commercial limits.
  • Testing covers the dedicated testing library.

eigen_api is the generated transport package used inside eigen_client. Game apps do not depend on or import it directly. For wire-level lookup, use the HTTP API reference or openapi.json.

Versioned docs

The latest link follows the newest stable package. To inspect the API for a version pinned in an older app, open that release from the eigen_flutter versions list; pub.dev keeps dartdoc for every published version.