preference_engine 0.1.1
preference_engine: ^0.1.1 copied to clipboard
Durable append-only file storage engine for native Dart and Flutter apps.
example/preference_engine_example.dart
import 'dart:convert';
import 'dart:typed_data';
import 'package:preference_engine/preference_engine.dart';
/// Uses the in-memory backend for a deterministic test or command-line task.
Future<void> main() async {
final backend = MemoryBackend();
await backend.open(const MemoryLocation('example'));
await backend.commit(
BackendCommit([
BackendPut(
'settings/theme',
Uint8List.fromList(utf8.encode('dark')),
),
]),
);
final value = await backend.read('settings/theme');
print(utf8.decode(value!));
await backend.close();
}