Skip to content

[in_app_purchase] Fix broken dartdoc references in completePurchase#11648

Draft
ishaquehassan wants to merge 1 commit intoflutter:mainfrom
ishaquehassan:fix/118626-iap-completepurchase-docs
Draft

[in_app_purchase] Fix broken dartdoc references in completePurchase#11648
ishaquehassan wants to merge 1 commit intoflutter:mainfrom
ishaquehassan:fix/118626-iap-completepurchase-docs

Conversation

@ishaquehassan
Copy link
Copy Markdown

The dartdoc on InAppPurchase.completePurchase and InAppPurchasePlatform.completePurchase referenced a PurchaseException class and a PurchaseException.errorCode field, neither of which exists in this package. The actual class thrown by completePurchase is InAppPurchaseException and its error code field is named code. Because of the typo the dartdoc links rendered as broken on pub.dev and api.flutter.dev.

This PR rewrites the doc comment in both files to point at InAppPurchaseException, InAppPurchaseException.code, and InAppPurchaseException.message so the references resolve. The platform interface file also gains an errors/errors.dart import so the class is in scope for the dartdoc link. No runtime behavior changes.

Fixes flutter/flutter#118626

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@flutter-dashboard
Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request corrects dartdoc references in the completePurchase method across the in_app_purchase and in_app_purchase_platform_interface packages, replacing references to the non-existent PurchaseException and errorCode with InAppPurchaseException and code. It also adds a necessary import to the platform interface and updates the changelogs for both packages. I have no feedback to provide.

@stuartmorgan-g
Copy link
Copy Markdown
Collaborator

Thanks for the contribution! You’ve checked boxes in the PR checklist above that are not reflected in this PR, so I’m assuming this is a work in progress and am marking it as a Draft. Please review the checklist, updating the PR as appropriate, and when the state of the PR as posted reflects the checklist please feel free to mark it as ready for review.

@stuartmorgan-g stuartmorgan-g marked this pull request as draft May 5, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[in_app_purchase] completePurchase docs say that it throws PurchaseException, which does not seem to exist

2 participants