-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalytics_client.dart
More file actions
34 lines (24 loc) · 1.03 KB
/
analytics_client.dart
File metadata and controls
34 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import 'dart:async';
/// Additional method to track custom events with a specific type.
/// Follow the naming convention for event types.
/// Future trackInitLoginFlow() => trackEvent('init_login', properties: {...});
/// Future trackErrorLogin() => trackEvent('error_login', properties: {...});
abstract class AnalyticsClient {
/// Tracks an event with a function call and a name.
/// This is useful for tracking events that are triggered by specific actions.
/// Example usage:
/// trackFunction(() => loginWithEmailPassword(email, password), 'login_triggered', properties: {email: email});
Future trackFunction(
FutureOr<void> Function() fn,
String name, {
Map<String, dynamic>? properties,
});
Future trackEvent(String name, {Map<String, dynamic>? properties});
Future setUserId(String? userId);
Future setUserProperties(Map<String, dynamic> properties);
Future setUserProperty(String name, String value);
Future reset();
Future trackAppCreated();
Future trackAppUpdated();
Future trackAppDeleted();
}