OwnedPurchasesResult.fromMap constructor

OwnedPurchasesResult.fromMap(
  1. String source
)

Implementation

factory OwnedPurchasesResult.fromMap(String source) {
  Map<String, dynamic> jsonMap = json.decode(source);

  return OwnedPurchasesResult(
    continuationToken: jsonMap['continuationToken'] == null
        ? null
        : jsonMap['continuationToken'],
    errMsg: jsonMap['errMsg'] == null ? null : jsonMap['errMsg'],
    inAppPurchaseDataList: jsonMap['inAppPurchaseDataList'] == null
        ? null
        : List<InAppPurchaseData>.from(
            jsonMap['inAppPurchaseDataList']
                .map((dynamic x) => InAppPurchaseData.fromJson(x)),
          ).toList(),
    inAppSignature: jsonMap['inAppSignature'] == null
        ? null
        : List<String>.from(jsonMap['inAppSignature'].map((dynamic x) => x)),
    itemList: jsonMap['itemList'] == null
        ? null
        : (jsonMap['itemList'] as List<dynamic>)
            .map((dynamic e) => e.toString())
            .toList(),
    returnCode: jsonMap['returnCode'] == null
        ? null
        : jsonMap['returnCode'].toString(),
    status:
        jsonMap['status'] == null ? null : Status.fromMap(jsonMap['status']),
    placedInappPurchaseDataList:
        jsonMap['placedInappPurchaseDataList'] == null
            ? null
            : List<String>.from(jsonMap['placedInappPurchaseDataList']),
    placedInappSignatureList: jsonMap['placedInappSignatureList'] == null
        ? null
        : List<String>.from(jsonMap['placedInappSignatureList']),
    signatureAlgorithm: jsonMap['signatureAlgorithm'] == null
        ? null
        : jsonMap['signatureAlgorithm'],
    rawValue: source,
  );
}