mirror of
https://github.com/foss42/apidash.git
synced 2025-12-04 03:46:57 +08:00
add persisted theme toggle to RequestEditorPaneHome
This commit is contained in:
@@ -6,6 +6,9 @@ const String kDataBox = "data";
|
||||
// sequence of ids
|
||||
const String kDataBoxIds = "ids";
|
||||
|
||||
// dark theme boolean
|
||||
const String kDataBoxTheme = "theme";
|
||||
|
||||
Future<void> openBoxes() async {
|
||||
await Hive.initFlutter();
|
||||
await Hive.openBox(kDataBox);
|
||||
@@ -18,6 +21,9 @@ class HiveHandler {
|
||||
dataBox = Hive.box(kDataBox);
|
||||
}
|
||||
|
||||
dynamic getTheme() => dataBox.get(kDataBoxTheme);
|
||||
Future<void> setTheme(bool? theme) => dataBox.put(kDataBoxTheme, theme);
|
||||
|
||||
dynamic getIds() => dataBox.get(kDataBoxIds);
|
||||
Future<void> setIds(List<String>? ids) => dataBox.put(kDataBoxIds, ids);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user