jsettings 0.1.1 copy "jsettings: ^0.1.1" to clipboard
jsettings: ^0.1.1 copied to clipboard

JSON settings

jsettings.dart #

pub license: MPL CI codecov

A simple JSON key-value store for Dart.

Similar to shared_preferences on Linux and Windows but uses a filesystem watcher to provide change notifications.

import 'package:jsettings/jsettings.dart';
final settings = JSettings('/path/to/settings.json');
await settings.init();

print('Keys: ${settings.getKeys()}');

if (settings.hasKey('key')) {

settings.added.listen((key) => print('Added: $key'));
settings.changed.listen((key) => print('Changed: $key'));
settings.removed.listen((key) => print('Removed: $key'))

await settings.setValue('key', 'value');
await settings.resetValue('key');

await settings.close();