Skip to content

Commit

Permalink
Changed analysis options.
Browse files Browse the repository at this point in the history
Set implicit-casts true only.
  • Loading branch information
hyochan committed Jan 28, 2019
1 parent 3030851 commit 192277a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
analyzer:
strong-mode:
implicit-casts: false
implicit-casts: true
implicit-dynamic: false
48 changes: 25 additions & 23 deletions lib/flutter_inapp_purchase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FlutterInappPurchase {
if (skus == null || skus.contains(null)) return [];
skus = skus.toList();
if (Platform.isAndroid) {
dynamic result = await _channel.invokeMethod(
dynamic result = await _channel.invokeMethod<dynamic>(
'getItemsByType',
<String, dynamic>{
'type': _typeInApp[0],
Expand All @@ -92,7 +92,7 @@ class FlutterInappPurchase {

return extractItems(result);
} else if (Platform.isIOS) {
dynamic result = await _channel.invokeMethod(
dynamic result = await _channel.invokeMethod<dynamic>(
'getItems',
{
'skus': skus,
Expand All @@ -112,7 +112,7 @@ class FlutterInappPurchase {
if (skus == null || skus.contains(null)) return [];
skus = skus.toList();
if (Platform.isAndroid) {
dynamic result = await _channel.invokeMethod(
dynamic result = await _channel.invokeMethod<dynamic>(
'getItemsByType',
<String, dynamic>{
'type': _typeInApp[1],
Expand All @@ -122,7 +122,7 @@ class FlutterInappPurchase {

return extractItems(result);
} else if (Platform.isIOS) {
dynamic result = await _channel.invokeMethod(
dynamic result = await _channel.invokeMethod<dynamic>(
'getItems',
{
'skus': skus,
Expand All @@ -141,14 +141,14 @@ class FlutterInappPurchase {
/// Identical to [getAvailablePurchases] on `iOS`.
static Future<List<PurchasedItem>> getPurchaseHistory() async {
if (Platform.isAndroid) {
dynamic result1 = await _channel.invokeMethod(
dynamic result1 = await _channel.invokeMethod<dynamic>(
'getPurchaseHistoryByType',
<String, dynamic>{
'type': _typeInApp[0],
},
);

dynamic result2 = await _channel.invokeMethod(
dynamic result2 = await _channel.invokeMethod<dynamic>(
'getPurchaseHistoryByType',
<String, dynamic>{
'type': _typeInApp[1],
Expand All @@ -157,7 +157,8 @@ class FlutterInappPurchase {

return extractPurchased(result1) + extractPurchased(result2);
} else if (Platform.isIOS) {
dynamic result = await _channel.invokeMethod('getAvailableItems');
dynamic result =
await _channel.invokeMethod<dynamic>('getAvailableItems');

return extractPurchased(json.encode(result));
}
Expand All @@ -170,14 +171,14 @@ class FlutterInappPurchase {
/// This is identical to [getPurchaseHistory] on `iOS`
static Future<List<PurchasedItem>> getAvailablePurchases() async {
if (Platform.isAndroid) {
dynamic result1 = await _channel.invokeMethod(
dynamic result1 = await _channel.invokeMethod<dynamic>(
'getAvailableItemsByType',
<String, dynamic>{
'type': _typeInApp[0],
},
);

dynamic result2 = await _channel.invokeMethod(
dynamic result2 = await _channel.invokeMethod<dynamic>(
'getAvailableItemsByType',
<String, dynamic>{
'type': _typeInApp[1],
Expand All @@ -186,7 +187,8 @@ class FlutterInappPurchase {

return extractPurchased(result1) + extractPurchased(result2);
} else if (Platform.isIOS) {
dynamic result = await _channel.invokeMethod('getAvailableItems');
dynamic result =
await _channel.invokeMethod<dynamic>('getAvailableItems');

return extractPurchased(json.encode(result));
}
Expand All @@ -199,8 +201,8 @@ class FlutterInappPurchase {
/// Identical to [buySubscription] on `iOS`.
static Future<PurchasedItem> buyProduct(String sku) async {
if (Platform.isAndroid) {
dynamic result =
await _channel.invokeMethod('buyItemByType', <String, dynamic>{
dynamic result = await _channel
.invokeMethod<dynamic>('buyItemByType', <String, dynamic>{
'type': _typeInApp[0],
'sku': sku,
'oldSku': null, //TODO can this be removed?
Expand All @@ -211,8 +213,8 @@ class FlutterInappPurchase {

return item;
} else if (Platform.isIOS) {
dynamic result = await _channel
.invokeMethod('buyProductWithFinishTransaction', <String, dynamic>{
dynamic result = await _channel.invokeMethod<dynamic>(
'buyProductWithFinishTransaction', <String, dynamic>{
'sku': sku,
});
result = json.encode(result);
Expand All @@ -233,8 +235,8 @@ class FlutterInappPurchase {
static Future<PurchasedItem> buySubscription(String sku,
{String oldSku}) async {
if (Platform.isAndroid) {
dynamic result =
await _channel.invokeMethod('buyItemByType', <String, dynamic>{
dynamic result = await _channel
.invokeMethod<dynamic>('buyItemByType', <String, dynamic>{
'type': _typeInApp[1],
'sku': sku,
'oldSku': oldSku,
Expand All @@ -244,8 +246,8 @@ class FlutterInappPurchase {
PurchasedItem item = PurchasedItem.fromJSON(param);
return item;
} else if (Platform.isIOS) {
dynamic result = await _channel
.invokeMethod('buyProductWithFinishTransaction', <String, dynamic>{
dynamic result = await _channel.invokeMethod<dynamic>(
'buyProductWithFinishTransaction', <String, dynamic>{
'sku': sku,
});
result = json.encode(result);
Expand Down Expand Up @@ -300,8 +302,8 @@ class FlutterInappPurchase {
static Future<PurchasedItem> buyProductWithoutFinishTransaction(
String sku) async {
if (Platform.isAndroid) {
dynamic result =
await _channel.invokeMethod('buyItemByType', <String, dynamic>{
dynamic result = await _channel
.invokeMethod<dynamic>('buyItemByType', <String, dynamic>{
'type': _typeInApp[0],
'sku': sku,
'oldSku': null,
Expand All @@ -311,8 +313,8 @@ class FlutterInappPurchase {
PurchasedItem item = PurchasedItem.fromJSON(param);
return item;
} else if (Platform.isIOS) {
dynamic result = await _channel
.invokeMethod('buyProductWithoutFinishTransaction', <String, dynamic>{
dynamic result = await _channel.invokeMethod<dynamic>(
'buyProductWithoutFinishTransaction', <String, dynamic>{
'sku': sku,
});
result = json.encode(result);
Expand Down Expand Up @@ -348,7 +350,7 @@ class FlutterInappPurchase {
return List<IAPItem>();
} else if (Platform.isIOS) {
dynamic result =
await _channel.invokeMethod('getAppStoreInitiatedProducts');
await _channel.invokeMethod<dynamic>('getAppStoreInitiatedProducts');

return extractItems(json.encode(result));
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ homepage: https://github.com/dooboolab/flutter_inapp_purchase/blob/master/pubspe
environment:
sdk: '>=1.20.1 <3.0.0'
dependencies:
http: '>=0.11.3+16 <1.0.0'
http: '>=0.12.0 <1.0.0'
flutter:
sdk: flutter

Expand Down

0 comments on commit 192277a

Please sign in to comment.