Skip to content
pubscout

local_value

1.2.0, released 4 years ago by an unverified publisher

An abstraction layer to persist data to the local file system, shared preferences, or secure storage.

Unverified publisher
$ flutter pub add local_value
Source repository

What it does

Provides a simple strongly-typed API for saving, reading, and deleting singletons and collections in the local file system, shared preferences, or secure storage. It abstracts underlying packages like path_provider, shared_preferences, and flutter_secure_storage.

AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want a simple key-value or document-based abstraction over files, shared preferences, and secure storage.
  • You need to store user preferences, cached JSON, or singletons like the current user.

Skip it when

  • You need complex relational queries, indexing, or ACID transactions provided by a full SQL database.
  • You need a robust, web-first local database solution.

Strengths

  • Simple and intuitive API with LocalValue and LocalSingleton classes.
  • Supports multiple document types including secure storage and shared preferences.
  • Fully unit test covered.

Weaknesses

  • Relies on underlying plugins for backend implementations.
  • Not suitable for complex querying or relational data modeling.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

No special native setup required beyond the dependencies handled by pub.

final localCounterValue = LocalSingleton<int>(id: 'counter_val');
await localCounterValue.write(5);
print(await localCounterValue.read());

Alternatives

Packages that do the same job and could replace local_value.

  • sqflite

    If your application requires a full relational SQLite database for complex querying.

Works with

Packages commonly used together with local_value: ones it builds on, ones built on it, and its own family.