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:
co-authored by
Claude Sonnet 4.6
parent
90aab51a26
commit
5e92d2b908
@@ -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],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user