malibayram/hive_listener
A tiny widget to listen hive box changes
- Stars
- 7
- Forks
- 3
- Last push (UTC)
- Jun 21, 2021
- Project status
- Active
LanguagesDartRubyHTMLSwiftKotlinObjective-C
Dependencies used
Dependency list 3 items
- flutter
{"sdk":"flutter"} - hive
^2.0.4 - hive_flutter
^1.1.0
Original README
English project snapshot. Visit GitHub for the latest content.
Expand / collapse project README
hive_listener
A tiny widget to listen hive box changes
How to use
HiveListener(
box: Hive.box('settings'),
keys: ['dark_theme'], // keys is optional to specify listening value changes
builder: (box) {
return MaterialApp(
title: 'Flutter Demo',
theme: box.get('dark_theme', defaultValue: false) ? ThemeData.dark() : ThemeData.light(),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
},
)
- note: if you want to use without null safety, you can select 0.1.0 version