Profile.fromJson constructor
Implementation
factory Profile.fromJson(Map<String, dynamic> json) {
return Profile(
id: json['id'] as String,
username: json['username'] as String,
bio: json['biography'] as String?,
imageUrl: json['imageUrl'] as String?,
level: Level(exp: json['xp'] as int, level: json['level'] as int),
lives: json['lives'] as int,
coins: json['coins'] as int,
streakDays: (json['streakDays'] as List<dynamic>)
.map((e) => DateTime.parse(e as String))
.toList(),
);
}