Reworked ugly code

This commit is contained in:
SomnusVeritas
2023-10-21 13:18:56 +02:00
parent efee307130
commit e7631a2668
4 changed files with 98 additions and 58 deletions

View File

@@ -1,10 +1,12 @@
import 'reward.dart';
class Game {
final int id;
final String name;
final List<Map<String, dynamic>> rewards;
final List<Reward> rewards;
Game.fromMap(Map<String, dynamic> map, Iterable<Map<String, dynamic>> rewards)
: id = map['id'],
name = map['name'],
rewards = rewards.toList();
rewards = rewards.map((e) => Reward.fromMap(e)).toList();
}