fix: replace Timestamp.toDate() with DateTime.tryParse in score list screens

score.createdAt is now String (ISO 8601) not Firebase Timestamp, so .toDate()
was a compile error. Use DateTime.tryParse() with fallback to DateTime.now().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-18 12:28:07 -05:00
co-authored by Claude Sonnet 4.6
parent 90aab51a26
commit 5e92d2b908
2 changed files with 2 additions and 2 deletions
@@ -94,7 +94,7 @@ class _ProfessionalScoreListScreenState
),
const SizedBox(width: 5),
Text(
'${score.createdAt.toDate().day}/${score.createdAt.toDate().month}/${score.createdAt.toDate().year}',
'${(DateTime.tryParse(score.createdAt) ?? DateTime.now()).day}/${(DateTime.tryParse(score.createdAt) ?? DateTime.now()).month}/${(DateTime.tryParse(score.createdAt) ?? DateTime.now()).year}',
style: TextStyle(
color: Colors.grey[600],
),
@@ -93,7 +93,7 @@ class _UserScoreListScreenState extends State<UserScoreListScreen> {
),
const SizedBox(width: 5),
Text(
'${score.createdAt.toDate().day}/${score.createdAt.toDate().month}/${score.createdAt.toDate().year}',
'${(DateTime.tryParse(score.createdAt) ?? DateTime.now()).day}/${(DateTime.tryParse(score.createdAt) ?? DateTime.now()).month}/${(DateTime.tryParse(score.createdAt) ?? DateTime.now()).year}',
style: TextStyle(
color: Colors.grey[600],
),