Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong type purchase package purchase product #301

Merged
merged 6 commits into from
Jan 18, 2022
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
67 changes: 31 additions & 36 deletions lib/models/discount.freezed.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target

part of 'discount.dart';
Expand Down Expand Up @@ -40,7 +41,7 @@ class _$DiscountTearOff {
);
}

Discount fromJson(Map<String, Object> json) {
Discount fromJson(Map<String, Object?> json) {
return Discount.fromJson(json);
}
}
Expand Down Expand Up @@ -275,37 +276,31 @@ class _$_Discount implements _Discount {
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _Discount &&
(identical(other.identifier, identifier) ||
const DeepCollectionEquality()
.equals(other.identifier, identifier)) &&
(identical(other.price, price) ||
const DeepCollectionEquality().equals(other.price, price)) &&
(identical(other.priceString, priceString) ||
const DeepCollectionEquality()
.equals(other.priceString, priceString)) &&
(identical(other.cycles, cycles) ||
const DeepCollectionEquality().equals(other.cycles, cycles)) &&
(identical(other.period, period) ||
const DeepCollectionEquality().equals(other.period, period)) &&
(identical(other.periodUnit, periodUnit) ||
const DeepCollectionEquality()
.equals(other.periodUnit, periodUnit)) &&
(identical(other.periodNumberOfUnits, periodNumberOfUnits) ||
const DeepCollectionEquality()
.equals(other.periodNumberOfUnits, periodNumberOfUnits)));
(other.runtimeType == runtimeType &&
other is _Discount &&
const DeepCollectionEquality()
.equals(other.identifier, identifier) &&
const DeepCollectionEquality().equals(other.price, price) &&
const DeepCollectionEquality()
.equals(other.priceString, priceString) &&
const DeepCollectionEquality().equals(other.cycles, cycles) &&
const DeepCollectionEquality().equals(other.period, period) &&
const DeepCollectionEquality()
.equals(other.periodUnit, periodUnit) &&
const DeepCollectionEquality()
.equals(other.periodNumberOfUnits, periodNumberOfUnits));
}

@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(identifier) ^
const DeepCollectionEquality().hash(price) ^
const DeepCollectionEquality().hash(priceString) ^
const DeepCollectionEquality().hash(cycles) ^
const DeepCollectionEquality().hash(period) ^
const DeepCollectionEquality().hash(periodUnit) ^
const DeepCollectionEquality().hash(periodNumberOfUnits);
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(identifier),
const DeepCollectionEquality().hash(price),
const DeepCollectionEquality().hash(priceString),
const DeepCollectionEquality().hash(cycles),
const DeepCollectionEquality().hash(period),
const DeepCollectionEquality().hash(periodUnit),
const DeepCollectionEquality().hash(periodNumberOfUnits));

@JsonKey(ignore: true)
@override
Expand Down Expand Up @@ -335,37 +330,37 @@ abstract class _Discount implements Discount {

/// Identifier of the discount.
@JsonKey(name: 'identifier')
String get identifier => throw _privateConstructorUsedError;
String get identifier;
@override

/// Identifier of the discount.
@JsonKey(name: 'price')
double get price => throw _privateConstructorUsedError;
double get price;
@override

/// Formatted price, including its currency sign, such as €3.99.
@JsonKey(name: 'priceString')
String get priceString => throw _privateConstructorUsedError;
String get priceString;
@override

/// Number of subscription billing periods for which the user will be given the discount, such as 3.
@JsonKey(name: 'cycles')
int get cycles => throw _privateConstructorUsedError;
int get cycles;
@override

/// Billing period of the discount, specified in ISO 8601 format.
@JsonKey(name: 'period')
String get period => throw _privateConstructorUsedError;
String get period;
@override

/// Unit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR.
@JsonKey(name: 'periodUnit')
String get periodUnit => throw _privateConstructorUsedError;
String get periodUnit;
@override

/// Number of units for the billing period of the discount.
@JsonKey(name: 'periodNumberOfUnits')
int get periodNumberOfUnits => throw _privateConstructorUsedError;
int get periodNumberOfUnits;
@override
@JsonKey(ignore: true)
_$DiscountCopyWith<_Discount> get copyWith =>
Expand Down
122 changes: 54 additions & 68 deletions lib/models/entitlement_info_wrapper.freezed.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target

part of 'entitlement_info_wrapper.dart';
Expand Down Expand Up @@ -65,7 +66,7 @@ class _$EntitlementInfoTearOff {
);
}

EntitlementInfo fromJson(Map<String, Object> json) {
EntitlementInfo fromJson(Map<String, Object?> json) {
return EntitlementInfo.fromJson(json);
}
}
Expand Down Expand Up @@ -505,63 +506,48 @@ class _$_EntitlementInfo implements _EntitlementInfo {
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _EntitlementInfo &&
(identical(other.identifier, identifier) ||
const DeepCollectionEquality()
.equals(other.identifier, identifier)) &&
(identical(other.isActive, isActive) ||
const DeepCollectionEquality()
.equals(other.isActive, isActive)) &&
(identical(other.willRenew, willRenew) ||
const DeepCollectionEquality()
.equals(other.willRenew, willRenew)) &&
(identical(other.latestPurchaseDate, latestPurchaseDate) ||
const DeepCollectionEquality()
.equals(other.latestPurchaseDate, latestPurchaseDate)) &&
(identical(other.originalPurchaseDate, originalPurchaseDate) ||
const DeepCollectionEquality().equals(
other.originalPurchaseDate, originalPurchaseDate)) &&
(identical(other.productIdentifier, productIdentifier) ||
const DeepCollectionEquality()
.equals(other.productIdentifier, productIdentifier)) &&
(identical(other.isSandbox, isSandbox) ||
const DeepCollectionEquality()
.equals(other.isSandbox, isSandbox)) &&
(identical(other.ownershipType, ownershipType) ||
const DeepCollectionEquality()
.equals(other.ownershipType, ownershipType)) &&
(identical(other.store, store) ||
const DeepCollectionEquality().equals(other.store, store)) &&
(identical(other.periodType, periodType) ||
const DeepCollectionEquality()
.equals(other.periodType, periodType)) &&
(identical(other.expirationDate, expirationDate) ||
const DeepCollectionEquality()
.equals(other.expirationDate, expirationDate)) &&
(identical(other.unsubscribeDetectedAt, unsubscribeDetectedAt) ||
const DeepCollectionEquality().equals(
other.unsubscribeDetectedAt, unsubscribeDetectedAt)) &&
(identical(other.billingIssueDetectedAt, billingIssueDetectedAt) ||
const DeepCollectionEquality().equals(
other.billingIssueDetectedAt, billingIssueDetectedAt)));
(other.runtimeType == runtimeType &&
other is _EntitlementInfo &&
const DeepCollectionEquality()
.equals(other.identifier, identifier) &&
const DeepCollectionEquality().equals(other.isActive, isActive) &&
const DeepCollectionEquality().equals(other.willRenew, willRenew) &&
const DeepCollectionEquality()
.equals(other.latestPurchaseDate, latestPurchaseDate) &&
const DeepCollectionEquality()
.equals(other.originalPurchaseDate, originalPurchaseDate) &&
const DeepCollectionEquality()
.equals(other.productIdentifier, productIdentifier) &&
const DeepCollectionEquality().equals(other.isSandbox, isSandbox) &&
const DeepCollectionEquality()
.equals(other.ownershipType, ownershipType) &&
const DeepCollectionEquality().equals(other.store, store) &&
const DeepCollectionEquality()
.equals(other.periodType, periodType) &&
const DeepCollectionEquality()
.equals(other.expirationDate, expirationDate) &&
const DeepCollectionEquality()
.equals(other.unsubscribeDetectedAt, unsubscribeDetectedAt) &&
const DeepCollectionEquality()
.equals(other.billingIssueDetectedAt, billingIssueDetectedAt));
}

@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(identifier) ^
const DeepCollectionEquality().hash(isActive) ^
const DeepCollectionEquality().hash(willRenew) ^
const DeepCollectionEquality().hash(latestPurchaseDate) ^
const DeepCollectionEquality().hash(originalPurchaseDate) ^
const DeepCollectionEquality().hash(productIdentifier) ^
const DeepCollectionEquality().hash(isSandbox) ^
const DeepCollectionEquality().hash(ownershipType) ^
const DeepCollectionEquality().hash(store) ^
const DeepCollectionEquality().hash(periodType) ^
const DeepCollectionEquality().hash(expirationDate) ^
const DeepCollectionEquality().hash(unsubscribeDetectedAt) ^
const DeepCollectionEquality().hash(billingIssueDetectedAt);
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(identifier),
const DeepCollectionEquality().hash(isActive),
const DeepCollectionEquality().hash(willRenew),
const DeepCollectionEquality().hash(latestPurchaseDate),
const DeepCollectionEquality().hash(originalPurchaseDate),
const DeepCollectionEquality().hash(productIdentifier),
const DeepCollectionEquality().hash(isSandbox),
const DeepCollectionEquality().hash(ownershipType),
const DeepCollectionEquality().hash(store),
const DeepCollectionEquality().hash(periodType),
const DeepCollectionEquality().hash(expirationDate),
const DeepCollectionEquality().hash(unsubscribeDetectedAt),
const DeepCollectionEquality().hash(billingIssueDetectedAt));

@JsonKey(ignore: true)
@override
Expand Down Expand Up @@ -610,81 +596,81 @@ abstract class _EntitlementInfo implements EntitlementInfo {

/// The entitlement identifier configured in the RevenueCat dashboard
@JsonKey(name: 'identifier')
String get identifier => throw _privateConstructorUsedError;
String get identifier;
@override

/// True if the user has access to this entitlement
@JsonKey(name: 'isActive')
bool get isActive => throw _privateConstructorUsedError;
bool get isActive;
@override

/// True if the underlying subscription is set to renew at the end of
/// the billing period (expirationDate). Will always be True if entitlement
/// is for lifetime access.
@JsonKey(name: 'willRenew')
bool get willRenew => throw _privateConstructorUsedError;
bool get willRenew;
@override

/// The latest purchase or renewal date for the entitlement.
@JsonKey(name: 'latestPurchaseDate')
String get latestPurchaseDate => throw _privateConstructorUsedError;
String get latestPurchaseDate;
@override

/// The first date this entitlement was purchased
@JsonKey(name: 'originalPurchaseDate')
String get originalPurchaseDate => throw _privateConstructorUsedError;
String get originalPurchaseDate;
@override

/// The product identifier that unlocked this entitlement
@JsonKey(name: 'productIdentifier')
String get productIdentifier => throw _privateConstructorUsedError;
String get productIdentifier;
@override

/// False if this entitlement is unlocked via a production purchase
@JsonKey(name: 'isSandbox')
bool get isSandbox => throw _privateConstructorUsedError;
bool get isSandbox;
@override

/// Use this property to determine whether a purchase was made by the current
/// user or shared to them by a family member. This can be useful for
/// onboarding users who have had an entitlement shared with them, but might
/// not be entirely aware of the benefits they now have.
@JsonKey(name: 'ownershipType', unknownEnumValue: OwnershipType.unknown)
OwnershipType get ownershipType => throw _privateConstructorUsedError;
OwnershipType get ownershipType;
@override

/// The store where this entitlement was unlocked from
/// Either: appStore, macAppStore, playStore, stripe, promotional, unknownStore
@JsonKey(name: 'store', unknownEnumValue: Store.unknownStore)
Store get store => throw _privateConstructorUsedError;
Store get store;
@override

/// The last period type this entitlement was in
/// Either: normal, intro, trial
@JsonKey(name: 'periodType', unknownEnumValue: PeriodType.unknown)
PeriodType get periodType => throw _privateConstructorUsedError;
PeriodType get periodType;
@override

/// The expiration date for the entitlement, can be `null` for lifetime access.
/// If the `periodType` is `trial`, this is the trial expiration date.
@JsonKey(name: 'expirationDate', nullable: true)
String? get expirationDate => throw _privateConstructorUsedError;
String? get expirationDate;
@override

/// The date an unsubscribe was detected. Can be `null` if it's still
/// subscribed or product is not a subscription.
/// @note: Entitlement may still be active even if user has unsubscribed.
/// Check the `isActive` property.
@JsonKey(name: 'unsubscribeDetectedAt', nullable: true)
String? get unsubscribeDetectedAt => throw _privateConstructorUsedError;
String? get unsubscribeDetectedAt;
@override

/// The date a billing issue was detected. Can be `null` if there is no
/// billing issue or an issue has been resolved.
/// @note: Entitlement may still be active even if there is a billing issue.
/// Check the `isActive` property.
@JsonKey(name: 'billingIssueDetectedAt', nullable: true)
String? get billingIssueDetectedAt => throw _privateConstructorUsedError;
String? get billingIssueDetectedAt;
@override
@JsonKey(ignore: true)
_$EntitlementInfoCopyWith<_EntitlementInfo> get copyWith =>
Expand Down
24 changes: 12 additions & 12 deletions lib/models/entitlement_infos_wrapper.freezed.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target

part of 'entitlement_infos_wrapper.dart';
Expand Down Expand Up @@ -29,7 +30,7 @@ class _$EntitlementInfosTearOff {
);
}

EntitlementInfos fromJson(Map<String, Object> json) {
EntitlementInfos fromJson(Map<String, Object?> json) {
return EntitlementInfos.fromJson(json);
}
}
Expand Down Expand Up @@ -156,18 +157,17 @@ class _$_EntitlementInfos implements _EntitlementInfos {
@override
bool operator ==(dynamic other) {
return identical(this, other) ||
(other is _EntitlementInfos &&
(identical(other.all, all) ||
const DeepCollectionEquality().equals(other.all, all)) &&
(identical(other.active, active) ||
const DeepCollectionEquality().equals(other.active, active)));
(other.runtimeType == runtimeType &&
other is _EntitlementInfos &&
const DeepCollectionEquality().equals(other.all, all) &&
const DeepCollectionEquality().equals(other.active, active));
}

@override
int get hashCode =>
runtimeType.hashCode ^
const DeepCollectionEquality().hash(all) ^
const DeepCollectionEquality().hash(active);
int get hashCode => Object.hash(
runtimeType,
const DeepCollectionEquality().hash(all),
const DeepCollectionEquality().hash(active));

@JsonKey(ignore: true)
@override
Expand All @@ -191,12 +191,12 @@ abstract class _EntitlementInfos implements EntitlementInfos {

/// Map of all EntitlementInfo (`EntitlementInfo`) objects (active and inactive)
/// keyed by entitlement identifier.
Map<String, EntitlementInfo> get all => throw _privateConstructorUsedError;
Map<String, EntitlementInfo> get all;
@override

/// Map of active EntitlementInfo (`EntitlementInfo`) objects keyed by
/// entitlement identifier.
Map<String, EntitlementInfo> get active => throw _privateConstructorUsedError;
Map<String, EntitlementInfo> get active;
@override
@JsonKey(ignore: true)
_$EntitlementInfosCopyWith<_EntitlementInfos> get copyWith =>
Expand Down
Loading