EntitlementInfo constructor
const
EntitlementInfo(
- @JsonKey(name: 'identifier') String identifier,
- @JsonKey(name: 'isActive') bool isActive,
- @JsonKey(name: 'willRenew') bool willRenew,
- @JsonKey(name: 'latestPurchaseDate') String latestPurchaseDate,
- @JsonKey(name: 'originalPurchaseDate') String originalPurchaseDate,
- @JsonKey(name: 'productIdentifier') String productIdentifier,
- @JsonKey(name: 'isSandbox') bool isSandbox, {
- @Default(OwnershipType.unknown) @JsonKey(name: 'ownershipType', unknownEnumValue: OwnershipType.unknown) OwnershipType ownershipType,
- @Default(Store.unknownStore) @JsonKey(name: 'store', unknownEnumValue: Store.unknownStore) Store store,
- @Default(PeriodType.unknown) @JsonKey(name: 'periodType', unknownEnumValue: PeriodType.unknown) PeriodType periodType,
- @JsonKey(name: 'expirationDate', nullable: true) String? expirationDate,
- @JsonKey(name: 'unsubscribeDetectedAt', nullable: true) String? unsubscribeDetectedAt,
- @JsonKey(name: 'billingIssueDetectedAt', nullable: true) String? billingIssueDetectedAt,
Implementation
const factory EntitlementInfo(
/// The entitlement identifier configured in the RevenueCat dashboard
@JsonKey(name: 'identifier')
String identifier,
/// True if the user has access to this entitlement
@JsonKey(name: 'isActive')
bool isActive,
/// 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 willRenew,
/// The latest purchase or renewal date for the entitlement.
@JsonKey(name: 'latestPurchaseDate')
String latestPurchaseDate,
/// The first date this entitlement was purchased
@JsonKey(name: 'originalPurchaseDate')
String originalPurchaseDate,
/// The product identifier that unlocked this entitlement
@JsonKey(name: 'productIdentifier')
String productIdentifier,
/// False if this entitlement is unlocked via a production purchase
@JsonKey(name: 'isSandbox')
bool isSandbox, {
/// 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.
@Default(OwnershipType.unknown)
@JsonKey(
name: 'ownershipType',
unknownEnumValue: OwnershipType.unknown,
)
OwnershipType ownershipType,
/// The store where this entitlement was unlocked from
/// Either: appStore, macAppStore, playStore, stripe, promotional, unknownStore
@Default(Store.unknownStore)
@JsonKey(name: 'store', unknownEnumValue: Store.unknownStore)
Store store,
/// The last period type this entitlement was in
/// Either: normal, intro, trial
@Default(PeriodType.unknown)
@JsonKey(name: 'periodType', unknownEnumValue: PeriodType.unknown)
PeriodType periodType,
/// 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? expirationDate,
/// 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? unsubscribeDetectedAt,
/// 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? billingIssueDetectedAt,
}) = _EntitlementInfo;