Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0+6

* Add missing `hashCode` implementations.

## 0.2.0+5

* iOS: Support unsupported UserInfo value types on NSError.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ui' show hashValues;
import 'dart:async';
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
Expand Down Expand Up @@ -236,6 +237,9 @@ class SKError {
DeepCollectionEquality.unordered()
.equals(typedOther.userInfo, userInfo);
}

@override
int get hashCode => hashValues(this.code, this.domain, this.userInfo);
}

/// Dart wrapper around StoreKit's
Expand Down Expand Up @@ -327,6 +331,14 @@ class SKPaymentWrapper {
typedOther.requestData == requestData;
}

@override
int get hashCode => hashValues(
this.productIdentifier,
this.applicationUsername,
this.quantity,
this.simulatesAskToBuyInSandbox,
this.requestData);

@override
String toString() => _$SKPaymentWrapperToJson(this).toString();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart';
import 'package:json_annotation/json_annotation.dart';
import 'sk_product_wrapper.dart';
Expand Down Expand Up @@ -173,6 +174,15 @@ class SKPaymentTransactionWrapper {
typedOther.error == error;
}

@override
int get hashCode => hashValues(
this.payment,
this.transactionState,
this.originalTransaction,
this.transactionTimeStamp,
this.transactionIdentifier,
this.error);

@override
String toString() => _$SKPaymentTransactionWrapperToJson(this).toString();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart';
import 'package:collection/collection.dart';
import 'package:json_annotation/json_annotation.dart';
Expand Down Expand Up @@ -55,6 +56,9 @@ class SkProductResponseWrapper {
DeepCollectionEquality().equals(
typedOther.invalidProductIdentifiers, invalidProductIdentifiers);
}

@override
int get hashCode => hashValues(this.products, this.invalidProductIdentifiers);
}

/// Dart wrapper around StoreKit's [SKProductPeriodUnit](https://developer.apple.com/documentation/storekit/skproductperiodunit?language=objc).
Expand Down Expand Up @@ -110,6 +114,9 @@ class SKProductSubscriptionPeriodWrapper {
final SKProductSubscriptionPeriodWrapper typedOther = other;
return typedOther.numberOfUnits == numberOfUnits && typedOther.unit == unit;
}

@override
int get hashCode => hashValues(this.numberOfUnits, this.unit);
}

/// Dart wrapper around StoreKit's [SKProductDiscountPaymentMode](https://developer.apple.com/documentation/storekit/skproductdiscountpaymentmode?language=objc).
Expand Down Expand Up @@ -187,6 +194,10 @@ class SKProductDiscountWrapper {
typedOther.paymentMode == paymentMode &&
typedOther.subscriptionPeriod == subscriptionPeriod;
}

@override
int get hashCode => hashValues(this.price, this.priceLocale,
this.numberOfPeriods, this.paymentMode, this.subscriptionPeriod);
}

/// Dart wrapper around StoreKit's [SKProduct](https://developer.apple.com/documentation/storekit/skproduct?language=objc).
Expand Down Expand Up @@ -272,6 +283,17 @@ class SKProductWrapper {
typedOther.subscriptionPeriod == subscriptionPeriod &&
typedOther.introductoryPrice == introductoryPrice;
}

@override
int get hashCode => hashValues(
this.productIdentifier,
this.localizedTitle,
this.localizedDescription,
this.priceLocale,
this.subscriptionGroupIdentifier,
this.price,
this.subscriptionPeriod,
this.introductoryPrice);
}

/// Object that indicates the locale of the price
Expand Down Expand Up @@ -307,4 +329,7 @@ class SKPriceLocaleWrapper {
final SKPriceLocaleWrapper typedOther = other;
return typedOther.currencySymbol == currencySymbol;
}

@override
int get hashCode => this.currencySymbol.hashCode;
}
2 changes: 1 addition & 1 deletion packages/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase
version: 0.2.0+5
version: 0.2.0+6

dependencies:
async: ^2.0.8
Expand Down