import 'dart:async'; import 'dart:developer'; import 'package:flutter/foundation.dart'; import 'package:lightmeter/data/analytics/api/analytics_api_interface.dart'; import 'package:lightmeter/data/analytics/entity/analytics_event.dart'; class LightmeterAnalytics { final ILightmeterAnalyticsApi _api; const LightmeterAnalytics({required ILightmeterAnalyticsApi api}) : _api = api; Future logEvent( LightmeterAnalyticsEvent event, { Map? parameters, }) async { if (kDebugMode) { log(' logEvent: ${event.name} / $parameters'); return; } return _api.logEvent( event: event, parameters: parameters, ); } Future logUnlockProFeatures(String listTileTitle) async { return logEvent( LightmeterAnalyticsEvent.unlockProFeatures, parameters: {"listTileTitle": listTileTitle}, ); } }