AchievementProgress.fromJson constructor
Factory constructor to parse from JSON.
Implementation
factory AchievementProgress.fromJson(Map<String, dynamic> json) {
return AchievementProgress(
name: json['name'] as String?,
description: json['description'] as String?,
type: json['type'] as String?,
count: json['count'] as int?,
tiers: json['tiers'] != null
? (json['tiers'] as List).map((t) => TierAnchor.fromJson(t)).toList()
: null,
currentTier: json['currentTier'] != null
? AchievementTier.fromString(json['currentTier'])
: null,
nextTier: json['nextTier'] != null
? AchievementTier.fromString(json['nextTier'])
: null,
nextTierTripsRequired: json['nextTierTripsRequired'] as int?,
remainingTrips: json['remainingTrips'] as int?,
);
}