FLUTTER ECOSYSTEM

state_persistence

Persist state across app launches. By default this library store state as a local JSON file called `data.json` in the applications data directory.

Latest version
0.1.0
30-day downloads
31
Likes
65
Pub points
140

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

The state_persistence package enables persistent storage of application state across app launches in Flutter. It automatically saves state to a local JSON file named `data.json` in the app's data directory, ensuring data survives restarts and device reboots. The library is designed for simplicity, offering an easy-to-use API that integrates seamlessly with state management solutions. It supports multiple platforms including Android, iOS, macOS, Windows, and Linux, making it ideal for cross-platform apps requiring reliable state retention.

Use cases
  • Saving user preferences between sessions
  • Persisting form data during app restarts
  • Maintaining UI state after app close
  • Storing cached data for offline use
  • Enabling seamless app resumption
Key features
  • Automatic JSON file persistence
  • Cross-platform support
  • Simple API integration
  • Configurable file path and name
  • Lightweight and fast serialization
Suitable for
  • Apps needing long-term state retention
  • Developers using simple state management
  • Projects requiring minimal setup for persistence
  • Offline-capable applications
  • Prototypes and MVPs
Considerations
  • File size may grow over time if not managed
  • Sensitive data should be encrypted before saving
  • Not suitable for large datasets without optimization
  • Requires manual handling of schema changes
  • Limited to JSON format by default
Supported platformsAndroidiOSmacOSWindowsLinux

Install package

flutter pub add state_persistence

Categories

Source repository

Related projects

No data available yet.