Skip to content
Closed
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
4 changes: 4 additions & 0 deletions packages/in_app_purchase/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.2.1

* Fix `countryCode` API.

## 3.2.0

* Adds `countryCode` API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,5 @@ class InAppPurchase implements InAppPurchasePlatformAdditionProvider {
/// See: https://developer.apple.com/documentation/storekit/skstorefront?language=objc
///
///
Future<String> countryCode() => InAppPurchasePlatform.instance.countryCode();
Future<String?> getCountryCode() => InAppPurchasePlatform.instance.getCountryCode();
}
2 changes: 1 addition & 1 deletion packages/in_app_purchase/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 3.2.0
version: 3.2.1

environment:
sdk: ^3.2.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ void main() {
]);
});

test('countryCode', () async {
final String country = await inAppPurchase.countryCode();
expect(country, 'USA');
test('getCountryCode', () async {
final String? countryCode = await inAppPurchase.getCountryCode();
expect(countryCode, 'USA');
expect(fakePlatform.log, <Matcher>[
isMethodCall('countryCode', arguments: null),
isMethodCall('getCountryCode', arguments: null),
]);
});

Expand Down Expand Up @@ -202,8 +202,8 @@ class MockInAppPurchasePlatform extends Fake
}

@override
Future<String> countryCode() {
log.add(const MethodCall('countryCode'));
Future<String> getCountryCode() {
log.add(const MethodCall('getCountryCode'));
return Future<String>.value('USA');
}
}