The web implementation of
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.
- Foreign Function Interface for interoperability with the C programming language. [...]
- HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
- Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.