Fantasma Flutter SDK
The Flutter SDK lives undersdks/flutter/fantasma_flutter.
Shared ingest and queue behavior lives on the SDK behavior
page.
Public API
FantasmaConfig(serverUrl, writeKey, storageNamespace, {localeProvider})FantasmaClient(config)track(eventName)flush()clear()close()
Usage
Install
The package name is:- Dart
>=3.4.0 <4.0.0 - Flutter
>=3.22.0
pub.dev.
Flutter-Specific Notes
- The package currently supports iOS and Android only.
- Tracked events auto-populate
platform,device,app_version,os_version, andlocale. storageNamespaceis required and defines the client-local persistence boundary for the queue, install identity, and blocked-destination state.- Only one live
FantasmaClientmay use a givenstorageNamespaceinside a process at a time. Reusing a namespace concurrently is rejected. localeProvideris resolved whentrack()enqueues the event; queued rows keep that snapshot even if the app locale changes later.- In addition to the shared upload triggers, the SDK also attempts best-effort flushes when the app pauses or backgrounds.
- Lifecycle-triggered and threshold-triggered flushes are best-effort background work and do not make
track()surface upload failures.