analytics_gen
2.3.0, released 4 weeks ago by shodev.live
Type-safe analytics event tracking generated from YAML configuration.
What it does
Generates type-safe Dart code, documentation, and export formats from YAML-based analytics tracking plans. Enforces parameter validation, allowed values, and multi-provider logging.
AI-written summary of version 2.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to maintain a centralized analytics tracking plan in YAML and generate type-safe tracking code.
- You need automated validation for event parameters, regex rules, and allowed values.
- You require multi-provider fan-out and documentation outputs for stakeholders.
Skip it when
- You prefer writing all tracking code and event names manually without external plan files.
- You do not use YAML configurations or code generation workflows in your project.
Strengths
- Ensures compile-time type safety for event names and parameters.
- Generates documentation, exports, and supports multi-provider fan-out.
- Includes validation rules and enum generation for allowed values.
Weaknesses
- Requires maintaining and syncing separate YAML configuration files.
- Adds a code generation step to your development workflow.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 9
Add analytics_gen to dependencies, create your YAML tracking plan, configure analytics_gen.yaml, and run the generator via CLI.
Analytics.initialize(...);
Analytics.instance.logEvent(...);Alternatives
Packages that do the same job and could replace analytics_gen.
- dartdoc
A non-interactive HTML documentation generator for Dart source code.
89Compare - mixpanel_flutter
Official Mixpanel tracking SDK for Flutter analytics.
82Compare - ambilytics
Google Analytics wrapper for all Flutter platforms including Windows and Linux
57Compare - matomo_tracker
Cross-platform Matomo tracking client for analytics in Flutter apps.
72Compare
Works with
Packages commonly used together with analytics_gen: ones it builds on, ones built on it, and its own family.
- analyzeranalytics_gen depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamlanalytics_gen depends on itA Dart library for parsing YAML documents into Dart data structures.
- globanalytics_gen depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- source_spananalytics_gen depends on itStandard representation for source code locations, spans, and human-friendly error messages.
- argsanalytics_gen depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- fileanalytics_gen depends on itPluggable, mockable file system abstraction for Dart with in-memory support.