This app demonstrates routing, consent, multiple trackers (implemented as mocks in this repo—no real Firebase/Mixpanel/Amplitude keys required), offline delivery with selective retry, and widget wrappers (FlexClickTrack, FlexMountTrack, FlexTrackRouteObserver + FlexTrackRouteViewMixin on the home shell).
From the repository root:
cd example
flutter pub get
flutter runOn first launch you will see a privacy / consent dialog (backed by an in-memory mock store, not real SharedPreferences persistence across restarts in tests).
In debug mode on mobile or desktop, the app starts the FlexTrack Inspector (local HTTP dashboard). Watch the console for FlexTrack Inspector (open in browser): http://127.0.0.1:7788 and open that URL to see live events and tracker state. (Not available on Flutter Web.)
Open the Delivery tab to force the demo offline, queue events, simulate one failing destination, and flush again. The screen and Inspector both show which destinations succeeded, which were retained for retry, and the pending count. The queue is stored under the platform application-support directory. Pending events survive a full process restart and are replayed automatically on the next online launch. The Lab's simulated network state is also persisted: an app closed while Offline starts Offline and retains its queue until you switch it Online and flush. Consent choices use the platform SharedPreferences store.
Integration tests must target one device. If several devices are available (e.g. Linux desktop and Chrome), pick one explicitly:
cd example
flutter test integration_test -d linux
# or: flutter test integration_test -d chromeOn headless Linux CI you may need a virtual display (e.g. xvfb-run -a flutter test integration_test -d linux). The main repo CI runs unit/widget tests only; run integration tests locally or in a dedicated workflow.
For minimal patterns without this full demo UI, see:
| Directory | Purpose |
|---|---|
examples/static_app |
Static FlexTrack.* API only |
examples/riverpod_app |
FlexTrackClient via Riverpod after FlexTrack.setup |
examples/bloc_getit_app |
FlexTrackClient in GetIt; Cubit calls client.track |
cd example
flutter build web --base-href /flex_track/demo/Output is example/build/web/. The documentation workflow copies this tree into website/static/demo/ before deploying to GitHub Pages.