Skip to content
pubscout

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.

$ flutter pub add segment_analytics
Source repository

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

Works with

Packages commonly used together with segment_analytics: ones it builds on, ones built on it, and its own family.