pendingDifficultyRewards property
get pending difficulty rewards
Implementation
Map<String, int> get pendingDifficultyRewards {
Map<String, int> rewards = {};
var _r = stats["difficulty_increase_rewards_record"]?["pendingRewards"];
if (_r == null) return rewards;
for (final reward in _r) {
for (final item in reward?["difficultyIncreaseMissionRewards"]
?["items"]) {
if (rewards["itemType"] == null) {
rewards["itemType"] = 0;
}
rewards["itemType"] =
(rewards["itemType"] ?? 0) + (int.tryParse(item["quantity"]) ?? 0);
}
}
return rewards;
}