The web implementation of
Please set your constraint to
shared_preferences_web: '>=0.1.y+x <2.0.0'
Backward compatible 1.0.0 version is coming #
The plugin has reached a stable API, we guarantee that version
1.0.0 will be backward compatible with
shared_preferences_web: '>=0.1.y+x <2.0.0' as your dependency constraint to allow a smoother ecosystem migration.
For more details see: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
Import the package #
To use this plugin in your Flutter Web app, simply add it as a dependency in
pubspec.yaml alongside the base
(This is only temporary: in the future we hope to make this package an
"endorsed" implementation of
shared_preferences, so that it is automatically
included in your Flutter Web app when you depend on
This is what the above means to your
... dependencies: ... shared_preferences: ^0.5.4+8 shared_preferences_web: ^0.1.0 ...
Use the plugin #
Once you have the
shared_preferences_web dependency in your pubspec, you should
be able to use
package:shared_preferences as normal.
- Removed Android folder from
- Update lower bound of dart dependency to 2.1.0.
- Declare API stability and compatibility with
1.0.0(more details at: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0).
- Make the pedantic dev_dependency explicit.
- Bump gradle version to avoid bugs with android projects
- Remove unused onMethodCall method.
- Add an android/ folder with no-op implementation to workaround https://github.com/flutter/flutter/issues/46898.
- Bump lower constraint on Flutter version.
- Add stub podspec file.
- Adds a
- Remove the deprecated
author:field from pubspec.yaml
- Require Flutter SDK 1.10.0 or greater.
- Initial release.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: shared_preferences_web: ^0.1.2+7
2. Install it
You can install packages from the command line:
$ flutter pub get
Alternatively, your editor might support
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on May 26, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.8.1
- pana: 0.13.8-dev
- Flutter: 1.17.0
The package description is too short. (-11 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
shared_preferences_web.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
|Dart SDK||>=2.1.0 <3.0.0|