Files
App/lib/services/analytics_service.dart
Texas0295 3122ae4cc2 [FIX] linux: defer AnalyticsService init to avoid Firebase crash
Defer FirebaseAnalytics initialization to constructor to avoid crashes on
unsupported platforms (notably Linux). Replace class-level initialization
with nullable field and guarded calls.

Changes:
- remove class-level initialization of _analytics
- add private _init() invoked in constructor
- make _analytics nullable
- add null checks in logEvent() and setUserId()
- emit warning instead of throwing
- Linux builds no longer crash on startup

Signed-off-by: Texas0295 <kimura@texas0295.top>
2026-01-11 20:31:27 +08:00

13 KiB