📦 Perks is a simple-to-use persistent data storage.
- Adapters take care of read and write operations.
- Boxes abstract adapters to provide a way to perform operations on the data.
PerksFileAdapter
- Asynchronous file based storage.PerksFileSyncAdapter
- Synchronous file based storage.PerksMemoryAdapter
- Synchronous memory based storage.
PerksNameValueBox
- Asynchronous Name-Value (or Key-Value) paired database schema.PerksNameValueSyncBox
- Synchronous Name-Value (or Key-Value) paired database schema.PerksStringBox
- Asynchronous storage where data is stored as a single string.PerksStringSyncBox
- Synchronous storage where data is stored as a single string.
import 'package:perks/perks.dart';
final PerksNameValueBox<String> database = PerksNameValueBox<String>(
adapter: PerksFileAdapter('data.db'),
);
await database.set('hello', 'world');
print('Value of hello: ${await database.get('hello')}');