1import 'dart:developer';
3import 'package:posthog_flutter/posthog_flutter.dart';
13 final config = PostHogConfig(
'phc_SIuZySG7NLbMLvugy0DmYq36JvZQwbgNhwuZbie6Kln');
14 config.sessionReplay =
true;
15 config.sessionReplayConfig.maskAllImages =
false;
16 config.sessionReplayConfig.maskAllTexts =
false;
18 config.captureApplicationLifecycleEvents =
true;
19 config.host =
'https://us.i.posthog.com';
20 await Posthog().setup(config);
25 await Posthog().capture(
27 properties: properties,
30 log(
'Analytics tracking error: $e');
36 await Posthog().identify(
38 userProperties: userProperties,
41 log(
'Analytics identification error: $e');
47 await Posthog().reset();
49 log(
'Analytics reset error: $e');
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
String get(String locale)