handleLoggedOut method
Public handler for post-logout LOCAL cleanup (FCM-007, BEH-1/BEH-2).
Wired as a core priority-0 onLoggedOut callback by
DreamicServices.initialize. Calls the shared _performLocalLogoutCleanup
only — it deliberately does NOT call FirebaseMessaging.deleteToken() (see
that method for why). After it, a later login re-runs token capture (BEH-2);
the device doc itself is deleted by DeviceService.handleAboutToLogOut
(before signOut, while still authenticated).
Idempotent under the double onLoggedOut fire (BEH-18): an explicit
signOut(useFbAuthAlso: true) runs onLoggedOut, then Firebase's
auth-state-null path runs it again — every step here (null-safe cancel,
prefs removal, flag/timestamp resets) is safe to run twice.
Implementation
Future<void> handleLoggedOut() async {
logd('NotificationService: handleLoggedOut called');
await _performLocalLogoutCleanup();
}