flutter_jsettings 0.1.0
flutter_jsettings: ^0.1.0 copied to clipboard
JSON settings
flutter_jsettings #
A simple JSON key-value store for Flutter.
Similar to shared_preferences on Linux and Windows but uses a filesystem watcher to provide change notifications.
import 'package:flutter_jsettings/flutter_jsettings.dart';
copied to clipboard
ChangeNotifierProvider(
create: (_) => JSettingsNotifier('/path/to/settings.json'),
child: MyApp(),
)
copied to clipboard
Checkbox(
value: context.watch<JSettingsNotifier>().getBool('key') ?? false,
onChanged: (v) => context.read<JSettingsNotifier>().setValue('key', v),
),
copied to clipboard