segment_analytics
2.0.0, released 2 weeks ago by an unverified publisher
Add Segment analytics to your Flutter app to track events, user screens, and identities.
What it does
Provides a Segment analytics client for Flutter applications across Android, iOS, macOS, and Web. It handles event tracking, screen views, identifying users, grouping, and flushing batches to endpoints using a plugin and timeline architecture.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to integrate Segment analytics into a Flutter application.
- You want to track user actions, lifecycle events, and automatic or manual screen views.
Skip it when
- Your project uses a Flutter version older than 3.38 (unless pinning to version 1.1.13).
- You require a non-Segment analytics provider and do not want to pull in Segment dependencies.
Strengths
- Supports multiple platforms including Android, iOS, macOS, and Web.
- Provides built-in methods for tracking, screens, identify, group, alias, and reset.
- Extensible via plugins and flush policies.
Weaknesses
- Requires Flutter 3.38+ for the latest 2.0.0 release.
- Project is currently in Beta phase and covered by Segment's First Access & Beta Preview Terms.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 10
Add the dependency to pubspec.yaml, and for Android add ACCESS_NETWORK_STATE permission in AndroidManifest.xml.
const writeKey = 'SEGMENT_API_KEY';
final analytics = createClient(Configuration(writeKey));
analytics.track("View Product", properties: {
"productId": 123,
"productName": "Striped trousers"
});Alternatives
Packages that do the same job and could replace segment_analytics.
- ambilytics
Google Analytics wrapper for all Flutter platforms including Windows and Linux
57Compare
Works with
Packages commonly used together with segment_analytics: ones it builds on, ones built on it, and its own family.
- uuidsegment_analytics depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- websegment_analytics depends on itLightweight bindings for browser APIs via JS interop
- json_annotationsegment_analytics depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- plugin_platform_interfacesegment_analytics depends on itReusable base class for platform interfaces of Flutter federated plugins.
- path_providersegment_analytics depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- shared_preferencessegment_analytics depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- state_notifiersegment_analytics depends on itValueNotifier outside Flutter for managing state in an immutable manner.
- loggersegment_analytics depends on itAn extensible logger for printing formatted logs with levels, custom filters, and printers.