Logging & Debugging
Use Talker, Dio diagnostics, Riverpod observers, and profile-aware error handling safely.
Logging stack
The Flutter template uses:
Talkerfromhelpers/log.dartfor application logs.TalkerDioLoggeron Dio for request/response/error diagnostics.TalkerRiverpodObserverinmain.dartfor provider state transitions.- Provider error states and
ApiResultparsing for user-facing failures.
The current interceptors are registered during Dio setup; do not assume all logging disappears in release. Configure/restrict logging for production builds.
Sensitive data warning
Dio is configured to print request headers/data, and _injectToken() currently logs token-injection diagnostics. Never ship bearer tokens, passwords, reset tokens, FCM tokens, or PII in logs. Remove/redact those fields or gate Talker interceptors behind a debug/build flag before production distribution.
API debugging
Check:
API_BASE_URLis the host root and reachable from the device.Endpoints.buildApiPathadds/api/v1exactly once.- Laravel is running and the Sanctum token is valid.
- Go, if enabled, can reach shared PostgreSQL and Redis.
- Guest code is not invoking Account providers; Guest Dio calls fail closed intentionally.
A 401 invokes the unauthorized handler and clears the local Account session. Cache hits/stale-on-error are controlled by dio_cache_interceptor; use forceRefresh: true after mutations or when validating current session data.
Crash reporting
firebase_crashlytics is present in pubspec.yaml, but the template does not initialize a Crashlytics collection flow in main.dart. Do not document crash reporting as active until you add Firebase initialization, consent/collection policy, and release-symbol configuration.
Relevant files
helpers/log.dartservices/dio_service.dartservices/api_service.dartproviders/dio_provider.dartmain.dartbootstrap/account_bootstrap.dart
