-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[in_app_purchase] Added currency code and numerical price to product detail model. #3794
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
packages/in_app_purchase/in_app_purchase/lib/src/in_app_purchase/product_details.dart
Show resolved
Hide resolved
originalPriceAmountMicros: 1000, | ||
); | ||
|
||
ProductDetails productDetails = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also test productDetails.currencyCode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason I only decided to test the rawPrice
property is because it is the only one that has some additional logic in the constructors (String parsing for iOS, some math for Android).
I can of course also test currencyCode
, but since that's nothing more than a value being set, just like all the other pre-existing properties, it does make me wonder if those should then also be tested (e.g. title, description, etc).
I'm curious if you have any thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does make me wonder if those should then also be tested (e.g. title, description, etc).
Ideally, if we can, it would be nice to test all the properties being set with the constructor. It would be awesome if you could add those in this PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing! The changes have been added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There seems to be some merge conflicts. |
…product detail model. (flutter/plugins#3794)
…product detail model. (flutter/plugins#3794) (#80124)
* master: (397 commits) [in_app_purchase] Implementation of platform interface (flutter#3781) [google_sign_in] Add todo WRT correctly setting X-Goog-AuthUser header (flutter#3819) [tools] fix version check command not working for new packages (flutter#3818) [camera] android-rework part 1: Base classes to support Android Camera features (flutter#3795) fix MD (flutter#3815) Path provider windows crash fix (flutter#3814) [local_auth] docs update (flutter#3103) Update PULL_REQUEST_TEMPLATE.md (flutter#3801) [quick_actions] handle cold start on iOS correctly (flutter#3811) Replace path_provider_linux widget tests with simple unit tests (flutter#3812) [sensors] format dart code based on the new dart formatter (flutter#3809) [google_sign_in] Fix "pick account" on iOS (flutter#3805) [image_picker_platform_interface] Added pickMultiImage (flutter#3782) [in_app_purchase] Added currency code and numerical price to product detail model. (flutter#3794) [local_auth] Fix iOS crash when no localizedReason (flutter#3780) Fix and update version checks (flutter#3792) [in_app_purchase] Configured example app to use StoreKit Testing on iOS 14 (flutter#3772) [local_auth] Unnecessary reassignment in example removed (flutter#2983) [flutter_webview] Fix `allowsInlineMediaPlayback` ignored on iOS (flutter#3791) Switch script/tools over to the new analysis options (flutter#3777) ...
Adds the currency code and numerical price to the ProductDetail model, so users of the plugin are able to take care of formatting.
Solves flutter/flutter#65758
Pre-launch Checklist
[shared_preferences]
///
).