Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
analytics_service.dart
Go to the documentation of this file.
1import 'dart:developer';
2
3import 'package:posthog_flutter/posthog_flutter.dart';
4
7
9
11
12 Future<void> initialize() async {
13 final config = PostHogConfig('phc_SIuZySG7NLbMLvugy0DmYq36JvZQwbgNhwuZbie6Kln');
14 config.sessionReplay = true;
15 config.sessionReplayConfig.maskAllImages = false;
16 config.sessionReplayConfig.maskAllTexts = false;
17 config.debug = true;
18 config.captureApplicationLifecycleEvents = true;
19 config.host = 'https://us.i.posthog.com';
20 await Posthog().setup(config);
21 }
22
23 Future<void> captureEvent(String eventName, {Map<String, Object>? properties}) async {
24 try {
25 await Posthog().capture(
26 eventName: eventName,
27 properties: properties,
28 );
29 } catch (e) {
30 log('Analytics tracking error: $e');
31 }
32 }
33
34 Future<void> identify(String userId, {Map<String, Object>? userProperties}) async {
35 try {
36 await Posthog().identify(
38 userProperties: userProperties,
39 );
40 } catch (e) {
41 log('Analytics identification error: $e');
42 }
43 }
44
45 Future<void> reset() async {
46 try {
47 await Posthog().reset();
48 } catch (e) {
49 log('Analytics reset error: $e');
50 }
51 }
52}
sealed class CheckInOutEvent extends Equatable userId
static final AnalyticsService _instance
Future< void > captureEvent(String eventName, {Map< String, Object >? properties}) async
static AnalyticsService get instance
AnalyticsService _internal()
Future< void > reset() async
Future< void > identify(String userId, {Map< String, Object >? userProperties}) async
Future< void > initialize() async
class Partner String
String get(String locale)