Refactor benchmark data models with placeholder values

This commit is contained in:
hunteraraujo
2023-09-27 15:16:34 -07:00
parent e4d84dad0a
commit ec03170e6e
5 changed files with 32 additions and 24 deletions

View File

@@ -46,14 +46,14 @@ class Metrics {
///
/// Returns a new `Metrics` populated with values from the map.
factory Metrics.fromJson(Map<String, dynamic> json) => Metrics(
difficulty: json['difficulty'] ?? "",
difficulty: json['difficulty'] ?? 'placeholder',
success: json['success'],
attempted: json['attempted'],
attempted: json['attempted'] ?? false,
successPercentage: (json['success_percentage'] != null)
? json['success_percentage'].toDouble()
: 0.0,
cost: json['cost'] ?? "",
runTime: json['run_time'] ?? "",
cost: json['cost'] ?? 'placeholder',
runTime: json['run_time'] ?? 'placeholder',
);
/// Converts the `Metrics` instance to a map.