vyuh_plugin_storage_shared_preferences
SharedPreferencesStoragePlugin stores values as strings: write uses value.toString() and read uses getString. Choose this for simple string preferences rather than expecting arbitrary objects to round-trip.
How the pieces fit together
Choose a declaration
SharedPreferencesStoragePlugin
SharedPreferencesStoragePlugin
Public declaration in this package.
dart
final class SharedPreferencesStoragePlugin extends StoragePlugin with InitOncePluginDirectly declared public members:
dart
SharedPreferencesStoragePlugin();dart
Future<void> initOnce();dart
Future<void> disposeOnce();dart
Future<dynamic> read(String key);Returns the stored value of any type (values written by this plugin are strings), or null when key is missing.
dart
Future<dynamic> write(String key, dynamic value);Stores value.toString() and returns that string. Writing null deletes key and returns null.
dart
Future<bool> has(String key);dart
Future<bool> delete(String key);Returns false when key did not exist, as StoragePlugin.delete says.