Flutter SDK¶
Herald for Flutter is a set of Dart packages on pub.dev: the core, one package per vendor, a logger and a fake for your tests. Each vendor package works over that vendor's official Flutter plugin, so Herald adds no native code of its own.
API reference Notes Changelog Source
Installation¶
Add the core and one package for each analytics service you use:
All packages share one version. Each vendor package pulls in herald and that vendor's plugin.
Packages¶
| Package | What it is |
|---|---|
herald |
Events, properties and Herald itself. Pure Dart, with no Flutter, vendor SDK or DI library. |
herald_firebase |
Sends to Firebase Analytics (GA4), over firebase_analytics. |
herald_adjust |
Sends to Adjust, over adjust_sdk: events by dashboard token, purchases and ad revenue. |
herald_mixpanel |
Sends to Mixpanel, over mixpanel_flutter: events, user profile and super properties. |
herald_appsflyer |
Sends to AppsFlyer, over appsflyer_sdk 7: conversions, purchases, subscriptions and ad revenue. |
herald_meta |
Sends to Meta, over facebook_app_events: conversions and purchases, for Meta's ads. |
herald_amplitude |
Sends to Amplitude, over amplitude_flutter: events, user properties, screen views and revenue. |
herald_log |
Prints every call, for debug builds. Pure Dart. |
herald_testing |
FakeAnalyticsProvider, a fake vendor that records events so your tests can check them. |
herald_widgets |
Optional: tracking from widgets, such as screen views each time a screen becomes visible, and impressions. The Flutter counterpart of the Android SDK's herald-compose. Without it, your screens and blocs track through EventTrackerService as usual. |
Feature packages usually need only herald, plus the vendor package for each vendor they write a
factory for. The app, which
sets up Herald, depends on every vendor package.
Compatibility¶
Herald needs Dart 3.13 and Flutter 3.47 or newer. It is built and tested against these plugins:
| Plugin | Version |
|---|---|
firebase_analytics |
12.6 |
adjust_sdk |
5.8 |
mixpanel_flutter |
2.14 |
appsflyer_sdk |
7.0 |
facebook_app_events |
0.31 |
amplitude_flutter |
4.7 |
Each vendor package allows newer versions of its plugin within the same major version. A new major version of a plugin may need a Herald release.
Flutter notes¶
Where Flutter differs from the other platforms is in the Flutter notes.
Example app¶
The example app sends every
call to the log and to an on-screen timeline, and tests its analytics with herald_testing. It
tracks screen views both ways: some screens with herald_widgets, one from its own
code.