Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Flutter
  3. Streaming Shared Preferences

Streaming Shared Preferences

BSD-2-ClauseDartv1.0.2

A reactive key-value store for Flutter that extends shared_preferences with Streams for listening to value changes.

GitHubGitHub
248 stars25 forks0 contributors

What is Streaming Shared Preferences?

streaming_shared_preferences is a Flutter package that adds reactive streaming capabilities to the standard shared_preferences key-value store. It allows developers to listen to changes in persisted settings and automatically update the UI, solving the problem of manually synchronizing stored data with widget state.

Target Audience

Flutter developers building mobile apps that need persistent, reactive settings or user preferences, especially those already using shared_preferences who want to reduce state management boilerplate.

Value Proposition

Developers choose this package because it extends a familiar API with real-time updates, integrates seamlessly with Flutter widgets via PreferenceBuilder, and supports custom data types without requiring major architectural changes.

Overview

A reactive key-value store for Flutter projects. Like shared_preferences, but with Streams.

Use Cases

Best For

  • Building Flutter apps with reactive settings screens
  • Synchronizing UI themes or user preferences in real-time
  • Reducing boilerplate when persisting and observing simple state
  • Migrating from shared_preferences to a reactive alternative
  • Storing and observing custom object types in persistent storage
  • Creating apps where multiple widgets depend on the same persisted values

Not Ideal For

  • Apps where preferences are modified by native code or external processes outside Dart, as change detection is Dart-side only.
  • Projects requiring encrypted, high-performance, or large-scale local storage beyond simple key-value pairs, such as relational databases or NoSQL solutions.
  • Teams implementing complex state management architectures that prefer immutable state models or centralized stores like Redux over reactive streams for business logic.

Pros & Cons

Pros

Reactive UI Synchronization

Enables real-time UI updates by exposing preferences as Dart streams, allowing widgets to automatically reflect changes in persisted data without manual state handling, as shown with the PreferenceBuilder widget.

Familiar API Migration

Mirrors the standard shared_preferences API with methods like getInt and setValue, making it easy for existing users to adopt without rewriting code, as noted in the getting started guide.

Custom Type Storage

Supports complex objects via JsonAdapter with built-in serialization/deserialization, including integration with frameworks like built_value, allowing flexible data persistence beyond primitive types.

Synchronous Value Access

Provides getValue() on Preference objects for instant retrieval of current values, balancing reactive updates with performance needs in scenarios like button presses.

Cons

Dart-Only Reactivity Limitation

Change detection works only in Dart, so modifications via the standard SharedPreferences API (e.g., from native code) won't trigger stream updates, requiring careful integration in hybrid apps.

Inherited Platform Constraints

Relies on shared_preferences, which uses platform-specific storage and is unsuitable for sensitive data or large datasets, limiting scalability and security options.

Async Initialization Overhead

Requires asynchronous setup with WidgetsFlutterBinding.ensureInitialized() and awaiting instance, adding complexity to app startup compared to synchronous state solutions.

Frequently Asked Questions

Quick Stats

Stars248
Forks25
Contributors0
Open Issues6
Last commit4 years ago
CreatedSince 2019

Tags

#reactive-programming#key-value-store#mobile-development#flutter#shared-preferences#persistence#state-management

Built With

F
Flutter
D
Dart

Included in

Flutter59.5k
Auto-fetched 10 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub