updateLastSeen method
Updates the last seen timestamp for a user.
Implementation
Future<void> updateLastSeen(String userId) async {
try {
await _firestore.collection('users').doc(userId).set(
{'lastSeen': FieldValue.serverTimestamp()},
SetOptions(merge: true),
);
} catch (e) {
e.log("Error updating last seen:");
}
}