3. Read data

To read data, use the appropriate getter method provided by the
SharedPreferences class. For each setter there is a corresponding getter.
For example, you can use the getInt, getBool, and getString methods.

4. Remove data

To delete data, use the remove() method.

Supported types

Although key-value storage is easy and convenient to use,
it has limitations:

Only primitive types can be used: int, double, bool, string,
and stringList.

It’s not designed to store a lot of data.

For more information about shared preferences on Android,
see the shared preferences documentation
on the Android developers website.

Testing support

It’s a good idea to test code that persists data using
shared_preferences. You can do this by mocking out the
MethodChannel used by the shared_preferences library.