Map<String, dynamic> map = docSnapshot.data()!; DateTime dt = (map['timestamp'] as Timestamp).toDate();