mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 20:52:32 +00:00
NEW - [Home/Calendar] New "schedule" view to view all days as one list - [Home/Modules] Option to use module "brand" colours or the LunaSea list colours - [Search] Option to hide adult categories - [-arr/Catalogue] Ability to sort by date added - [-arr/Search] Show the indexer/tracker on the collapsed tile TWEAKS - [Development] Updated Flutter packages FIXES - Multiple smaller crash/error fixes Thanks to @lightglitch on GitHub for implementing the schedule calendar mode!
34 lines
949 B
Dart
34 lines
949 B
Dart
import 'package:lunasea/core/database.dart';
|
|
|
|
class SearchDatabase {
|
|
SearchDatabase._();
|
|
|
|
static void registerAdapters() {}
|
|
}
|
|
|
|
enum SearchDatabaseValue {
|
|
NAVIGATION_INDEX,
|
|
HIDE_XXX,
|
|
}
|
|
|
|
extension SearchDatabaseValueExtension on SearchDatabaseValue {
|
|
String get key {
|
|
switch(this) {
|
|
case SearchDatabaseValue.NAVIGATION_INDEX: return 'SEARCH_NAVIGATION_INDEX';
|
|
case SearchDatabaseValue.HIDE_XXX: return 'SEARCH_HIDE_XXX';
|
|
}
|
|
throw Exception('key not found');
|
|
}
|
|
|
|
dynamic get data {
|
|
final _box = Database.lunaSeaBox;
|
|
switch(this) {
|
|
case SearchDatabaseValue.NAVIGATION_INDEX: return _box.get(this.key, defaultValue: 0);
|
|
case SearchDatabaseValue.HIDE_XXX: return _box.get(this.key, defaultValue: false);
|
|
}
|
|
throw Exception('data not found');
|
|
}
|
|
|
|
void put(dynamic value) => Database.lunaSeaBox.put(this.key, value);
|
|
}
|