VerifyPurchaseResult.fromJson constructor

VerifyPurchaseResult.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory VerifyPurchaseResult.fromJson(Map<String, dynamic> json) {
  final typeName = json['__typename'] as String?;
  switch (typeName) {
    case 'VerifyPurchaseResultAndroid':
      return VerifyPurchaseResultAndroid.fromJson(json);
    case 'VerifyPurchaseResultHorizon':
      return VerifyPurchaseResultHorizon.fromJson(json);
    case 'VerifyPurchaseResultIOS':
      return VerifyPurchaseResultIOS.fromJson(json);
  }
  throw ArgumentError('Unknown __typename for VerifyPurchaseResult: $typeName');
}