Skip to content

Commit 045e651

Browse files
[in_app_purchase] Update iOS to new analysis options (flutter#4920)
1 parent 351415c commit 045e651

24 files changed

+531
-447
lines changed

packages/in_app_purchase/in_app_purchase_storekit/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.0+2
2+
3+
* Internal code cleanup for stricter analysis options.
4+
15
## 0.3.0+1
26

37
* Removes dependency on `meta`.

packages/in_app_purchase/in_app_purchase_storekit/analysis_options.yaml

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/in_app_purchase/in_app_purchase_storekit/example/integration_test/in_app_purchase_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// found in the LICENSE file.
44

55
import 'package:flutter_test/flutter_test.dart';
6-
import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart';
76
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';
7+
import 'package:in_app_purchase_storekit/in_app_purchase_storekit.dart';
88
import 'package:integration_test/integration_test.dart';
99

1010
void main() {

packages/in_app_purchase/in_app_purchase_storekit/example/lib/consumable_store.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import 'dart:async';
66
import 'package:shared_preferences/shared_preferences.dart';
77

8+
// ignore: avoid_classes_with_only_static_members
89
/// A store of consumable items.
910
///
10-
/// This is a development prototype tha stores consumables in the shared
11+
/// This is a development prototype that stores consumables in the shared
1112
/// preferences. Do not use this in real world apps.
1213
class ConsumableStore {
1314
static const String _kPrefKey = 'consumables';
14-
static Future<void> _writes = Future.value();
15+
static Future<void> _writes = Future<void>.value();
1516

1617
/// Adds a consumable with ID `id` to the store.
1718
///
@@ -32,19 +33,19 @@ class ConsumableStore {
3233
/// Returns the list of consumables from the store.
3334
static Future<List<String>> load() async {
3435
return (await SharedPreferences.getInstance()).getStringList(_kPrefKey) ??
35-
[];
36+
<String>[];
3637
}
3738

3839
static Future<void> _doSave(String id) async {
39-
List<String> cached = await load();
40-
SharedPreferences prefs = await SharedPreferences.getInstance();
40+
final List<String> cached = await load();
41+
final SharedPreferences prefs = await SharedPreferences.getInstance();
4142
cached.add(id);
4243
await prefs.setStringList(_kPrefKey, cached);
4344
}
4445

4546
static Future<void> _doConsume(String id) async {
46-
List<String> cached = await load();
47-
SharedPreferences prefs = await SharedPreferences.getInstance();
47+
final List<String> cached = await load();
48+
final SharedPreferences prefs = await SharedPreferences.getInstance();
4849
cached.remove(id);
4950
await prefs.setStringList(_kPrefKey, cached);
5051
}

0 commit comments

Comments
 (0)