prf
2.4.6, released a year ago by jozz.biz
Drop-in wrapper for SharedPreferences with type safety and zero boilerplate.
What it does
Makes local key-value persistence simpler by allowing developers to define variables once with typed Prf objects and use them anywhere with get() and set(). It supports primitives, enums, lists, and JSON without manual string key management.
AI-written summary of version 2.4.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want a cleaner, type-safe alternative to raw SharedPreferences.
- You want to avoid managing string keys and casting values manually across the app.
Skip it when
- You need complex relational queries or high-performance local databases.
- You require secure encryption out of the box for sensitive data.
Strengths
- Zero boilerplate with typed variable definitions.
- Automatic caching and isolate-safe options.
- Supports 20+ built-in types, enums, and JSON models seamlessly.
Weaknesses
- Relies underneath on SharedPreferences, making it unsuited for large relational datasets.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
No native platform setup required beyond adding the package to pubspec.yaml.
final playerCoins = Prf<int>('player_coins');
await playerCoins.set(100);
final coins = await playerCoins.get();Alternatives
Packages that do the same job and could replace prf.
- flutter_secure_storage
You need encrypted local storage for sensitive tokens or credentials.
93Compare - sqflite
You need a full relational SQL database instead of simple key-value storage.
96Compare
Works with
Packages commonly used together with prf: ones it builds on, ones built on it, and its own family.