funnelbase_flutter library
The analytics SDK for Flutter apps: the same event contract as the Android and iOS SDKs, because it is those SDKs — every call here goes to the native SDK on the device (docs/sdk-flutter.md).
await Analytics.initialize(const AnalyticsConfig(apiKey: key, endpoint: 'https://ingest.example.com'));
Analytics.track('checkout_completed', {'cart_total': 42.5, 'currency': 'EUR'});
Classes
- Analytics
-
The SDK's entire public surface, mirroring the native SDKs method for method:
initialize,track,screen,identify,flush,reset, push and topics. - AnalyticsConfig
- How the SDK behaves. Only the key and the endpoint have no default.
- AnalyticsDay
-
A calendar day with no time and no zone — a plan's renewal day, a birthday — read in whichever
zone asks. Sent as
YYYY-MM-DD, what a property or trait declareddatein the catalog accepts (docs/event-contract.md, "Dates"). The mirror ofjava.time.LocalDateon Android andAnalyticsDayon iOS. - Reports a screen view whenever the route on top of a Navigator changes: pushed, replaced, or revealed by a pop.
- AnalyticsPush
-
Push, as the SDK sees it: a token to register, the permission, and taps to route. Reached as
Analytics.push. - AnalyticsTopics
-
Notification topics: the kinds of message an app sends, each of which a person may switch off
or on. Reached as
Analytics.topics. - AndroidOptions
- What only the Android SDK reads: where a push is drawn.
- IosOptions
- What only the iOS SDK reads.
- PushButton
-
One action button under a notification. id is what the open reports as
action_id. - PushPayload
- A push the platform sent, as it arrived.
- PushTap
-
A tapped notification, handed to the app: the push, and which button was tapped, or null for
the notification itself. The SDK has already reported
$push_openedby the time the app sees one; what is left is routing, which only the app knows how to do. - TokenKinds
- What kind of address a push token is, as the registry records it.
- TopicChoice
- One of the app's notification topics, and where this person stands on it.
Typedefs
- ScreenNameExtractor = String? Function(Route route)
- Names the screen a route shows, or null for a route that is not a screen of its own.
Exceptions / Errors
- TopicsException
- Why the topics could not be read: the native SDKs' four cases.
- TopicsHttpException
-
The server answered, and not with a 2xx:
503 topics_unavailable, a bad key's 401. - TopicsMalformedException
- An answer arrived that is not the topics response.
- TopicsNetworkException
- No answer arrived: offline, a timeout, a refused connection.
- TopicsNotInitializedException
-
Analytics.initializehas not been called.