AnalyticsProvider class abstract
Abstract base for analytics providers.
Implement this to add custom analytics services.
class MyAnalytics extends AnalyticsProvider {
@override
String get name => 'my_analytics';
@override
void initialize() { /* setup */ }
@override
void trackPageView({required String path, String? title, Map<String, dynamic>? parameters}) {
// send page view
}
@override
void trackEvent({required String name, Map<String, dynamic>? parameters}) {
// send event
}
@override
void dispose() { /* cleanup */ }
}
- Implementers
Constructors
Properties
Methods
-
dispose(
) → void - Cleanup resources
-
initialize(
) → void - Initialize the provider (inject scripts, etc.)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setUserProperties(
Map< String, dynamic> properties) → void - Set user properties
-
toString(
) → String -
A string representation of this object.
inherited
-
trackEvent(
{required String name, Map< String, dynamic> ? parameters}) → void - Track a custom event
-
trackPageView(
{required String path, String? title, Map< String, dynamic> ? parameters}) → void - Track a page view
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited