EntitlementInfo constructor

const EntitlementInfo(
  1. String identifier,
  2. bool isActive,
  3. bool willRenew,
  4. String latestPurchaseDate,
  5. String originalPurchaseDate,
  6. String productIdentifier,
  7. bool isSandbox, {
  8. @Default(OwnershipType.unknown) @JsonKey(name: 'ownershipType', unknownEnumValue: OwnershipType.unknown) OwnershipType ownershipType,
  9. @Default(Store.unknownStore) @JsonKey(name: 'store', unknownEnumValue: Store.unknownStore) Store store,
  10. @Default(PeriodType.unknown) @JsonKey(name: 'periodType', unknownEnumValue: PeriodType.unknown) PeriodType periodType,
  11. String? expirationDate,
  12. String? unsubscribeDetectedAt,
  13. String? billingIssueDetectedAt,
})

Implementation

const factory EntitlementInfo(
  /// The entitlement identifier configured in the RevenueCat dashboard
  String identifier,

  /// True if the user has access to this entitlement
  bool isActive,

  /// True if the underlying subscription is set to renew at the end of
  /// the billing period (expirationDate).
  bool willRenew,

  /// The latest purchase or renewal date for the entitlement.
  String latestPurchaseDate,

  /// The first date this entitlement was purchased
  String originalPurchaseDate,

  /// The product identifier that unlocked this entitlement
  String productIdentifier,

  /// False if this entitlement is unlocked via a production purchase
  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)
  // ignore: invalid_annotation_target
  @JsonKey(
    name: 'ownershipType',
    unknownEnumValue: OwnershipType.unknown,
  )
      OwnershipType ownershipType,

  /// The store where this entitlement was unlocked from
  @Default(Store.unknownStore)
  // ignore: invalid_annotation_target
  @JsonKey(
    name: 'store',
    unknownEnumValue: Store.unknownStore,
  )
      Store store,

  /// The last period type this entitlement was in
  @Default(PeriodType.unknown)
  // ignore: invalid_annotation_target
  @JsonKey(
    name: 'periodType',
    unknownEnumValue: PeriodType.unknown,
  )
      PeriodType periodType,

  /// The expiration date for the entitlement, can be null for lifetime access.
  /// If the [periodType] is [PeriodType.trial],
  /// this is the trial expiration date.
  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.
  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.
  String? billingIssueDetectedAt,
}) = _EntitlementInfo;