Skip to main content

data_save 0.4.6 copy "data_save: ^0.4.6" to clipboard
data_save: ^0.4.6 copied to clipboard

Simple Flutter storage over native SharedPreferences, with web cookies, localStorage for larger strings, and corrupt Windows preferences reset.

0.4.6 #

  • Clear native preferences in one backend operation instead of removing each key separately, including when calling removeAllLarge().
  • Reuse parsed web cookies while the browser's cookie header is unchanged; external changes and expiration remain visible on the next read.
  • Handle invalid percent escapes in legacy cookies without disrupting reads.

0.4.5 #

  • Added DataSave.getKeys() to list stored keys on native platforms and web.
  • Added setStringList() and getStringList() with JSON cookie storage on web.
  • Changed remove() to return Future<bool> indicating removal success.

0.4.4 #

  • Detect the default Windows preferences file during loading, so corrupt-file recovery works with DataSave.init() without supplying a path or adding any dependency. An explicit windowsPreferencesFilePath remains supported.

0.4.3 #

  • Added an optional windowsPreferencesFilePath to DataSave.init(). If loading on Windows throws FormatException, the supplied file is deleted so the next launch can start empty. Storage still uses SharedPreferences with no new dependencies; other load errors do not delete data.

0.4.0 #

  • Migrated the web implementation from deprecated dart:html APIs to package:web.
  • Added JavaScript and WebAssembly-compatible platform selection.
  • Safely encode cookie names and values, including Unicode and delimiters.
  • Use host-only cookies with SameSite=Lax and Secure on HTTPS.
  • Detect rejected and oversized cookies instead of failing silently.
  • Return null for missing or invalid typed values consistently.
  • Made DataSave.removeAll() awaitable.
  • Added setLargeString() and getLargeString() using localStorage on web with an in-memory fallback.
  • Added remove() for clearing the same key from both web storage modes and removeAllLarge() for clearing large-string storage.
  • removeAll() now clears both cookies and all localStorage values on web; large-string methods reuse the normal storage on native platforms.
  • Increased the minimum supported Dart SDK to 3.13.

0.3.6 #

  • Improved Flutter and Flutter Web compatibility.

0.0.1 #

  • Initial release.
2
likes
120
points
279
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Simple Flutter storage over native SharedPreferences, with web cookies, localStorage for larger strings, and corrupt Windows preferences reset.

Repository (GitHub)
View/report issues

License

BSL-1.0 (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, shared_preferences, web

More

Packages that depend on data_save