Browse documentation
Install hej in Flutter
Embed native Flutter guest text conversations with secure drafts and exact retries.
Use the source pilot for its supported scope
lobby_flutter 0.1.0 is an unreleased source package, not a pub.dev release. Its Flutter widgets call the existing hej HTTP API directly, without a WebView or Swift bridge. It includes guest foreground text chat, separate threads, 50-message history pages, secure subject/message drafts, exact-payload retry and viewport-gated display receipts. Host-signed identity/linking, photos, action execution, remote appearance, surveys/feedback, push and purchase callbacks are not included. Unsupported photo/action content gets explanatory text; verified-only configuration stops with the email fallback. No package, public ID, metadata or client interaction establishes customer identity, subscription entitlement or hej production access.
Install the actual extracted package
Keep packages/flutter and examples/flutter from the archive. Place the extracted root containing packages and examples at vendor/lobby-flutter in this example, and point the host dependency at its packages/flutter folder. That folder contains pubspec.yaml and lib. Run flutter pub get in the host. The package requires Flutter 3.32+/Dart 3.8+; the checked toolchain is Flutter 3.47.9/Dart 3.13.7. It uses http, crypto, characters and flutter_secure_storage. Follow the installed secure-storage plugin’s Keychain and Android backup setup, add Android’s INTERNET permission, and keep real release networking on HTTPS. The package stops on protected-storage failures and has no plaintext fallback.
# In your host pubspec.yaml:
dependencies:
lobby_flutter:
path: vendor/lobby-flutter/packages/flutter
# Then run in the host project:
# flutter pub getRetain the client and use the host route
Call WidgetsFlutterBinding.ensureInitialized() before using secure storage. Retain one LobbyClient in the existing host state and dispose it with that state. Supply the actual HTTPS origin, public ID and expected environment from App setup. LobbySupportView owns its Scaffold and composer; the surrounding Material theme, text scale and directionality remain the host’s. Push it from the existing Help entry without a second composer or overlay. Configuration is checked before private requests, and registration begins when Help opens. Optional onEmailSupport lets the host open its existing email composer; otherwise the support address is selectable and Copy draft remains available.
import 'package:flutter/material.dart';
import 'package:lobby_flutter/lobby_flutter.dart';
// Retain these members in your existing host State:
late final support = LobbyClient(options: LobbyOptions(
baseUrl: Uri.parse('https://YOUR_LOBBY_ORIGIN'),
configId: 'YOUR_PUBLIC_DEVELOPMENT_ID',
environment: 'development',
));
// In the host's existing build method:
ListTile(
title: const Text('Help & support'),
onTap: () => Navigator.of(context).push(MaterialPageRoute<void>(
builder: (_) => LobbySupportView(client: support),
)),
);
// In the host State's dispose method:
// support.dispose();Fence account changes and preserve uncertain attempts
Close Help and await resetForAccountSwitch() before another host account can open it. Calling reset fences earlier callbacks immediately, then durably clears private state and retains known old credentials for later revocation. It is not server deletion. If the protected write fails, keep Help closed and retry the reset. Content requests persist the full attempted JSON body, route, stable key and app/customer/session scope before sending. Retry saved attempt preserves that envelope across restart; newer drafts stay separate and definite errors keep them available. Interrupted registration and rotating refresh are not automatically replayed because those API transitions have no recovery contract. The client preserves the record and stops; copy drafts and contact support before explicitly resetting important guest history.
// In the host logout/account-change flow:
await support.resetForAccountSwitch();Verify your installed host
With a development configuration, send a synthetic question from the actual Flutter host, reply in the matching hej inbox, and observe that reply in the current active Help route. The view polls only while its route is current and the app is resumed. Fetch receipts are separate from displayed/read receipts, which require a reply bubble to intersect the visible viewport. Current source analysis is clean and 22 focused core/widget tests pass, including delayed reads, background renewal and stale post-send follow-ups. An earlier isolated iOS host compiled for the simulator with the actual secure-storage plugin; that compiled host was not launched and is not a native build of this final source. Current native compilation, installed UI/device storage, a hosted Flutter two-way conversation, accessibility tasks and provider delivery remain unverified. Neither a test pass nor the earlier compilation establishes production entitlement.