Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
[shared_preferences] Fix example in readme for mocking values (#4411)
Browse files Browse the repository at this point in the history
This fixes the example for mocking values in the readme of shared_preferences.
After the NNBD migration mock values can only be of type Object.
  • Loading branch information
ueman authored Dec 10, 2021
1 parent e74df9b commit f9f6597
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/shared_preferences/shared_preferences/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.11

* Corrects example for mocking in readme.

## 2.0.10

* Removes obsolete manual registration of Windows and Linux implementations.
Expand Down
3 changes: 2 additions & 1 deletion packages/shared_preferences/shared_preferences/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ _incrementCounter() async {
You can populate `SharedPreferences` with initial values in your tests by running this code:

```dart
SharedPreferences.setMockInitialValues (Map<String, dynamic> values);
Map<String, Object> values = <String, Object>{'counter': 1};
SharedPreferences.setMockInitialValues(values);
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for reading and writing simple key-value pairs.
Wraps NSUserDefaults on iOS and SharedPreferences on Android.
repository: https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+shared_preferences%22
version: 2.0.10
version: 2.0.11

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down

0 comments on commit f9f6597

Please sign in to comment.