Skip to main content
This quickstart configures the official Dart SDK, checks whether takeout ordering is available, and loads a published menu without a browser API key or BFF.

1. Install

pubspec.yaml
Run flutter pub get.

2. Configure deployment values

Pass deployment-specific values with --dart-define:
For sandbox testing, replace the origin and identifiers with the exact sandbox deployment values provided for your account. Sandbox and production have separate environment variables and data; never reuse a StorefrontSessionStore record or customer token across those origins.

3. Create the client

This anonymous guest quickstart needs no customer-token provider. The in-memory store makes the sample runnable, but it loses the cart when the process exits. Before shipping, replace it with a StorefrontSessionStore backed by encrypted platform storage.

4. Check availability and load the menu

getOrderingReadiness is anonymous and side-effect free. Starting an ordering session is the point where the SDK receives and stores the guest cart capability and revision.

5. Start an order

Keep one client per application session so its serialized cart lifecycle protects monotonic revisions. Dispose it with client.close() when the application-level owner is torn down.

6. Surface safe failures

See the Dart and Flutter Storefront SDK guide for session storage, cancellation, conflict recovery, and security guidance.