AnalyticsPlugin class final

The default implementation of analytics tracking in Vyuh applications.

The analytics plugin provides a unified interface for tracking user behavior and application events. It supports:

  • Multiple analytics providers (e.g., Firebase, Mixpanel)
  • Automatic navigation tracking
  • User identification and traits
  • Custom event tracking with parameters

The plugin manages multiple providers simultaneously, allowing you to send analytics data to multiple services. Each provider can have its own configuration and implementation.

Example providers:

  • Firebase Analytics
  • Google Analytics
  • Mixpanel
  • Custom analytics services
Inheritance
Implemented types
Mixed-in types
Available extensions

Constructors

AnalyticsPlugin.new({required List<AnalyticsProvider> providers})
Creates a new AnalyticsPlugin with the given providers.

Properties

description String
The description of the provider.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
initialized bool
no setterinherited
name String
finalinherited
observers List<NavigatorObserver>
Navigation observers for automatic route tracking.
no setteroverride
providers List<AnalyticsProvider>
The list of analytics providers managed by this plugin.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
finalinherited

Methods

dispose() Future<void>
inherited
disposeOnce() Future<void>
Disposes all analytics providers.
override
identifyUser(String userId, {Map<String, dynamic>? traits}) Future<void>
Identifies a user across all analytics providers.
override
init() Future<void>
inherited
initOnce() Future<void>
Initializes all analytics providers.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reportEvent(String name, {Map<String, dynamic>? params}) Future<void>
Reports an analytics event to all providers.
override
reportUserEvent(UserEventType eventType, {ContentItem? content}) → void

Available on AnalyticsPlugin, provided by the UserEvents extension

Reports a user event on the content item.
resetUser() Future<void>
Resets the user identity across all analytics providers.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited