Skip to content

Commit 98e1012

Browse files
committed
[shared_preferences] Switch to new analysis options
1 parent 9191378 commit 98e1012

File tree

10 files changed

+57
-71
lines changed

10 files changed

+57
-71
lines changed
Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
## 1.0.0
22

3-
* Initial release
3+
* Initial release.
44

55
## 1.0.1
66

7-
* Update shared_preferences to 0.5.12+4
8-
* Update platform interface to 1.0.4
9-
* Migrate to Tizen 4.0
7+
* Update shared_preferences to 0.5.12+4.
8+
* Update shared_preferences_platform_interface to 1.0.4.
9+
* Migrate to Tizen 4.0.
1010

1111
## 2.0.0
1212

13-
* Update Dart and Flutter SDK constraints
14-
* Update Flutter copyright information
15-
* Update example and integration_test
16-
* Update platform interface to 2.0.0
17-
* Organize dev_dependencies
18-
* Migrate to ffi 1.0.0
19-
* Migrate to null safety
20-
* Remove unused `PreferenceIsExisiting` from the implementation
13+
* Update Dart and Flutter SDK constraints.
14+
* Update Flutter copyright information.
15+
* Update the example app and integration_test.
16+
* Update shared_preferences_platform_interface to 2.0.0.
17+
* Organize dev_dependencies.
18+
* Migrate to ffi 1.0.0.
19+
* Migrate to null safety.
20+
* Remove unused `PreferenceIsExisiting` from the implementation.
2121

2222
## 2.0.1
2323

24-
* Fix memory leaks
24+
* Fix memory leaks.
25+
26+
## 2.0.2
27+
28+
* Update shared_preferences to 2.0.9.
29+
* Switch to new analysis options and update integration_test.

packages/shared_preferences/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This package is not an _endorsed_ implementation of `shared_preferences`. Theref
88

99
```yaml
1010
dependencies:
11-
shared_preferences: ^2.0.5
12-
shared_preferences_tizen: ^2.0.1
11+
shared_preferences: ^2.0.9
12+
shared_preferences_tizen: ^2.0.2
1313
```
1414
1515
Then you can import `shared_preferences` in your Dart code:

packages/shared_preferences/analysis_options.yaml

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

packages/shared_preferences/example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Demonstrates how to use the shared_preferences_tizen plugin.
44

55
## Getting Started
66

7-
To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
7+
To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).

packages/shared_preferences/example/integration_test/shared_preferences_test.dart

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,27 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// @dart=2.9
6-
7-
import 'dart:async';
85
import 'package:flutter_test/flutter_test.dart';
9-
import 'package:shared_preferences/shared_preferences.dart';
106
import 'package:integration_test/integration_test.dart';
7+
import 'package:shared_preferences/shared_preferences.dart';
118

129
void main() {
1310
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
1411

1512
group('$SharedPreferences', () {
16-
const Map<String, dynamic> kTestValues = <String, dynamic>{
17-
'flutter.String': 'hello world',
18-
'flutter.bool': true,
19-
'flutter.int': 42,
20-
'flutter.double': 3.14159,
21-
'flutter.List': <String>['foo', 'bar'],
22-
};
13+
const String testString = 'hello world';
14+
const bool testBool = true;
15+
const int testInt = 42;
16+
const double testDouble = 3.14159;
17+
const List<String> testList = <String>['foo', 'bar'];
2318

24-
const Map<String, dynamic> kTestValues2 = <String, dynamic>{
25-
'flutter.String': 'goodbye world',
26-
'flutter.bool': false,
27-
'flutter.int': 1337,
28-
'flutter.double': 2.71828,
29-
'flutter.List': <String>['baz', 'quox'],
30-
};
19+
const String testString2 = 'goodbye world';
20+
const bool testBool2 = false;
21+
const int testInt2 = 1337;
22+
const double testDouble2 = 2.71828;
23+
const List<String> testList2 = <String>['baz', 'quox'];
3124

32-
SharedPreferences preferences;
25+
late SharedPreferences preferences;
3326

3427
setUp(() async {
3528
preferences = await SharedPreferences.getInstance();
@@ -54,43 +47,36 @@ void main() {
5447

5548
testWidgets('writing', (WidgetTester _) async {
5649
await Future.wait(<Future<bool>>[
57-
preferences.setString(
58-
'String', kTestValues2['flutter.String'] as String),
59-
preferences.setBool('bool', kTestValues2['flutter.bool'] as bool),
60-
preferences.setInt('int', kTestValues2['flutter.int'] as int),
61-
preferences.setDouble(
62-
'double', kTestValues2['flutter.double'] as double),
63-
preferences.setStringList(
64-
'List', kTestValues2['flutter.List'] as List<String>)
50+
preferences.setString('String', testString2),
51+
preferences.setBool('bool', testBool2),
52+
preferences.setInt('int', testInt2),
53+
preferences.setDouble('double', testDouble2),
54+
preferences.setStringList('List', testList2)
6555
]);
66-
expect(preferences.getString('String'), kTestValues2['flutter.String']);
67-
expect(preferences.getBool('bool'), kTestValues2['flutter.bool']);
68-
expect(preferences.getInt('int'), kTestValues2['flutter.int']);
69-
expect(preferences.getDouble('double'), kTestValues2['flutter.double']);
70-
expect(preferences.getStringList('List'), kTestValues2['flutter.List']);
56+
expect(preferences.getString('String'), testString2);
57+
expect(preferences.getBool('bool'), testBool2);
58+
expect(preferences.getInt('int'), testInt2);
59+
expect(preferences.getDouble('double'), testDouble2);
60+
expect(preferences.getStringList('List'), testList2);
7161
});
7262

7363
testWidgets('removing', (WidgetTester _) async {
7464
const String key = 'testKey';
75-
await preferences.setString(key, kTestValues['flutter.String'] as String);
76-
await preferences.setBool(key, kTestValues['flutter.bool'] as bool);
77-
await preferences.setInt(key, kTestValues['flutter.int'] as int);
78-
await preferences.setDouble(key, kTestValues['flutter.double'] as double);
79-
await preferences.setStringList(
80-
key, kTestValues['flutter.List'] as List<String>);
65+
await preferences.setString(key, testString);
66+
await preferences.setBool(key, testBool);
67+
await preferences.setInt(key, testInt);
68+
await preferences.setDouble(key, testDouble);
69+
await preferences.setStringList(key, testList);
8170
await preferences.remove(key);
8271
expect(preferences.get('testKey'), isNull);
8372
});
8473

8574
testWidgets('clearing', (WidgetTester _) async {
86-
await preferences.setString(
87-
'String', kTestValues['flutter.String'] as String);
88-
await preferences.setBool('bool', kTestValues['flutter.bool'] as bool);
89-
await preferences.setInt('int', kTestValues['flutter.int'] as int);
90-
await preferences.setDouble(
91-
'double', kTestValues['flutter.double'] as double);
92-
await preferences.setStringList(
93-
'List', kTestValues['flutter.List'] as List<String>);
75+
await preferences.setString('String', testString);
76+
await preferences.setBool('bool', testBool);
77+
await preferences.setInt('int', testInt);
78+
await preferences.setDouble('double', testDouble);
79+
await preferences.setStringList('List', testList);
9480
await preferences.clear();
9581
expect(preferences.getString('String'), null);
9682
expect(preferences.getBool('bool'), null);

packages/shared_preferences/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ publish_to: "none"
55
dependencies:
66
flutter:
77
sdk: flutter
8-
shared_preferences: ^2.0.5
8+
shared_preferences: ^2.0.9
99
shared_preferences_tizen:
1010
path: ../
1111

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @dart=2.9
2-
31
import 'package:integration_test/integration_test_driver.dart';
42

53
Future<void> main() => integrationDriver();

packages/shared_preferences/example/tizen/Runner.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Tizen.NET.Sdk/1.1.5">
1+
<Project Sdk="Tizen.NET.Sdk/1.1.7">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest package="org.tizen.shared_preferences_tizen_example" version="1.0.0" api-version="4.0" xmlns="http://tizen.org/ns/packages">
33
<profile name="common"/>
4-
<ui-application appid="org.tizen.shared_preferences_tizen_example" exec="Runner.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" api-version="4" launch_mode="single">
4+
<ui-application appid="org.tizen.shared_preferences_tizen_example" exec="Runner.dll" type="dotnet" multiple="false" taskmanage="true" nodisplay="false" api-version="4">
55
<label>shared_preferences_tizen_example</label>
66
<icon>ic_launcher.png</icon>
77
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true"/>
8-
<metadata key="http://tizen.org/metadata/direct-launch" value="yes"/>
98
</ui-application>
109
<feature name="http://tizen.org/feature/screen.size.all"/>
1110
</manifest>

packages/shared_preferences/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ name: shared_preferences_tizen
22
description: Tizen implementation of the shared_preferences plugin
33
homepage: https://github.com/flutter-tizen/plugins
44
repository: https://github.com/flutter-tizen/plugins/tree/master/packages/shared_preferences
5-
version: 2.0.1
5+
version: 2.0.2
66

77
flutter:
88
plugin:
99
platforms:
1010
tizen:
1111
dartPluginClass: SharedPreferencesPlugin
12-
fileName: shared_preferences_tizen.dart
1312

1413
dependencies:
1514
ffi: ^1.1.2

0 commit comments

Comments
 (0)