MinecraftMod.fromMap constructor
MinecraftMod.fromMap(
- Map<String, dynamic> map
)
Implementation
factory MinecraftMod.fromMap(Map<String, dynamic> map) {
return MinecraftMod(
uuid: map['uuid']!,
name: map['name'],
description: map['description'],
id: map['id'],
supportVersions: List<MinecraftVersion>.from(
map['supportVersions']?.map((x) => MinecraftVersion.fromMap(x))),
relationMods: List<RelationMod>.from(
map['relationMods']?.map((x) => RelationMod.fromMap(x))),
integration: ModIntegrationPlatform.fromMap(map['integration']),
side: List<ModSide>.from(map['side']?.map((x) => ModSide.fromMap(x))),
lastUpdate:
DateTime.fromMillisecondsSinceEpoch(map['lastUpdate'], isUtc: true),
createTime:
DateTime.fromMillisecondsSinceEpoch(map['createTime'], isUtc: true),
loader: List<ModLoader>.from(
map['loader']?.map((x) => ModLoader.values.byName(x)) ?? []),
translatedName: map['translatedName'],
introduction: map['introduction'],
imageStorageUUID: map['imageStorageUUID'],
viewCount: map['viewCount'] ?? 0,
);
}