unilitix 2.0.5
unilitix: ^2.0.5 copied to clipboard
African-first mobile UX analytics for Flutter. Pure Dart SDK — track sessions, screens, events and crashes with a single line of code.
Unilitix Flutter SDK #
African-first mobile UX analytics for Flutter. Track sessions, screens, events and crashes with a single line of code.
Install #
flutter pub add unilitix
Quick start #
1. Initialize in main.dart #
import 'package:unilitix/unilitix.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Unilitix.init('your_api_key');
runApp(MyApp());
}
Get your API key at app.unilitix.com → Settings → Apps → Create App.
2. Add automatic screen tracking #
MaterialApp(
navigatorObservers: [Unilitix.observer],
)
That's it. Sessions, screen flows, taps and crashes are tracked automatically.
Track custom events #
Unilitix.track('purchase_completed', {
'amount': 5000,
'currency': 'NGN',
});
Verify your integration #
In debug mode, Unilitix prints a verification log to your console within 5 seconds of launch:
[Unilitix] ✅ SDK initialized
[Unilitix] ✅ Session started
[Unilitix] ⚠️ No screen events detected. Did you add Unilitix.observer
to your MaterialApp navigatorObservers?
The ⚠️ warning only appears if Unilitix.observer is missing from
navigatorObservers. It is silent in production builds.
Identify users #
// Call after login
Unilitix.identify('user_123', {
'name': 'Tosin',
'plan': 'pro',
'country': 'Nigeria',
});
// Call on logout
Unilitix.reset();
Configuration #
All options have sensible defaults. Only override what you need:
await Unilitix.init(
'your_api_key',
config: UnilitixConfig(
debug: true, // console logging
autoTrackScreens: true, // auto screen tracking
autoTrackTaps: true, // tap heatmaps
autoTrackCrashes: true, // crash reports
autoTrackRageTaps: true, // frustration detection
flushIntervalSeconds: 30, // upload frequency
sessionTimeoutSeconds: 1800, // session idle timeout
maskInputs: true, // hide sensitive fields
sampleRate: 1.0, // 100% of sessions
),
);
Privacy #
// User opts out of analytics
Unilitix.optOut();
// User opts back in
Unilitix.optIn();
Requirements #
| Platform | Minimum version |
|---|---|
| Android | API 21 (Android 5.0) |
| iOS | Planned — follow progress |
Support #
- Docs: docs.unilitix.com
- Email: support@unilitix.com
- Issues: GitHub Issues