Read and write files

Play and pause a video

Store key-value data on disk

Cookbook

Persistence

Store key-value data on disk

1. Add the dependency

2. Save data

3. Read data

4. Remove data

Supported types

Testing support

Complete example

If you have a relatively small collection of key-values
to save, you can use the shared_preferences plugin.

Normally,
you would have to write native platform integrations for storing
data on both iOS and Android. Fortunately,
the shared_preferences plugin can be used to persist
key-value data on disk. The shared preferences plugin
wraps NSUserDefaults on iOS and SharedPreferences on Android,
providing a persistent store for simple data.

This recipe uses the following steps: