Skip to content

Commit

Permalink
Fixed wrong casting in checkSubscribed method (#368)
Browse files Browse the repository at this point in the history
secures 

```
flutter: type 'Future<List<PurchasedItem>?>' is not a subtype of type 'FutureOr<List<PurchasedItem>>' in type cast
flutter: 
#0      FlutterInappPurchase.checkSubscribed (package:flutter_inapp_purchase/flutter_inapp_purchase.dart:509:39)
```
  • Loading branch information
kleeb authored Jun 11, 2022
1 parent 83312fb commit 9fce04f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/flutter_inapp_purchase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ class FlutterInappPurchase {
}) async {
if (_platform.isIOS) {
var history =
await (getPurchaseHistory() as FutureOr<List<PurchasedItem>>);
await (getPurchaseHistory() as Future<List<PurchasedItem>?>);

if (history == null) {
return false;
}

for (var purchase in history) {
Duration difference =
Expand Down

0 comments on commit 9fce04f

Please sign in to comment.