AppModel.fromJSON constructor
Generate model from JSON
Implementation
factory AppModel.fromJSON(Map<String, dynamic> data) {
return AppModel(
id: data[ApiKeys.id],
metaData: MetaInfo(
name: data[ApiKeys.meta][ApiKeys.name],
imageURL: data[ApiKeys.meta][ApiKeys.imageURL],
description: data[ApiKeys.meta][ApiKeys.description],
),
androidInfo: data[ApiKeys.android] == null
? null
: AndroidInfo(
playStoreURL: data[ApiKeys.android][ApiKeys.playStoreURL],
applicationId: data[ApiKeys.android][ApiKeys.applicationId],
sha256: List<String>.from(data[ApiKeys.android][ApiKeys.sha256]),
),
iosInfo: data[ApiKeys.iOS] == null
? null
: IOSInfo(
teamId: data[ApiKeys.iOS][ApiKeys.teamId],
bundleId: data[ApiKeys.iOS][ApiKeys.bundleId],
appStoreURL: data[ApiKeys.iOS][ApiKeys.appStoreURL],
),
);
}