Fix issue with decoding metrics JSON

This commit is contained in:
hunteraraujo
2023-09-24 22:30:37 -07:00
parent a6446ce43e
commit 470cfa6c4e

View File

@@ -49,7 +49,9 @@ class Metrics {
difficulty: json['difficulty'] ?? "",
success: json['success'],
attempted: json['attempted'],
successPercentage: json['success_percentage'].toDouble() ?? 0.0,
successPercentage: (json['success_percentage'] != null)
? json['success_percentage'].toDouble()
: 0.0,
cost: json['cost'] ?? "",
runTime: json['run_time'] ?? "",
);