apparent library

Apparent for Flutter: product events for the Apparent dashboard (apparent.fyi).

await Apparent.start(app: 'einb', key: '<write key>', disabled: kDebugMode);
Apparent.track('paywall_view', {'source': 'onboarding'});

Classes

Apparent
Apparent for Flutter apps.
ApparentClient
ApparentConfig
The config behind Apparent.start. Most fields are for tests.
ApparentDevice
What the phone is: sent once per batch as d.
ApparentEvent
An event as beforeSend sees it. Change name or props and return it, or return null to drop it.
ApparentNavigatorObserver
Records a screen_view for each page route that comes to the top: MaterialApp(navigatorObservers: [ApparentNavigatorObserver()]). The screen is the route's name (RouteSettings.name, e.g. "/settings" → "settings", "/" → "home", like the Expo router's names). Routes without a name, dialogs and sheets are skipped unless screenName names them.
ApparentStorage
Where ids, properties and the waiting events are kept between launches.
FileStorage
One small JSON file per key in a folder (the app's support folder, see Apparent.start). Written to a temporary file first and renamed over the old one, so a crash mid-write never leaves half a file.
MemoryStorage
Kept in memory only (tests, web).

Enums

ApparentAppState
Where the app is: in front, half hidden (a call, the app switcher), or in the background.

Constants

sdkVersion → const String
Sent as v in every batch, so the server can tell the SDKs apart.

Functions

A link that opened the app, safe to store (the Expo SDK's cleanDeepLink): secrets in the query or fragment become "redacted", a user:password@ is dropped, and the whole string is cut to 500 characters. Also has the utm_ campaign fields (utm_source, utm_medium, utm_campaign) when the link has them.
defaultScreenName(Route route) → String?
"/practice/recht" → "practice/recht", "/" → "home"; unnamed routes and popups (dialogs, sheets) → null.
errorFields(Object error, StackTrace? stack) → Map<String, Object?>
The "error" event's fields for something thrown, named like the Expo SDK names JavaScript errors.
readDevice() → Future<ApparentDevice>
The phone, named the way the Expo SDK names it: iOS version or Android API level, the hardware model ("iPhone15,2", "Pixel 8"), the app's version and build, the locale and region. No advertising ids.