mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-24 03:49:30 +00:00
feat: implement per book settings with player configuration and update methods
This commit is contained in:
parent
fd42ee2343
commit
e7dd4de515
19 changed files with 1030 additions and 20 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/foundation.dart' show immutable;
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:vaani/features/per_book_settings/models/book_settings.dart';
|
||||
import 'package:vaani/settings/models/models.dart';
|
||||
|
||||
@immutable
|
||||
|
|
@ -19,4 +20,8 @@ class AvailableHiveBoxes {
|
|||
/// stores the a list of [AuthenticatedUser]
|
||||
static final authenticatedUserBox =
|
||||
Hive.box<AuthenticatedUser>(name: 'authenticatedUser');
|
||||
|
||||
/// stores the a list of [BookSettings]
|
||||
static final individualBookSettingsBox =
|
||||
Hive.box<BookSettings>(name: 'bookSettings');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:hive/hive.dart';
|
||||
import 'package:vaani/features/per_book_settings/models/book_settings.dart';
|
||||
import 'package:vaani/settings/models/models.dart';
|
||||
|
||||
// register all models to Hive for serialization
|
||||
|
|
@ -19,4 +20,12 @@ Future registerModels() async {
|
|||
'AuthenticatedUser',
|
||||
((json) => AuthenticatedUser.fromJson(json)),
|
||||
);
|
||||
Hive.registerAdapter<BookSettings>(
|
||||
'BookSettings',
|
||||
((json) => BookSettings.fromJson(json)),
|
||||
);
|
||||
Hive.registerAdapter<BookSettings>(
|
||||
'_\$BookSettingsImpl', // hack because of freezed
|
||||
((json) => BookSettings.fromJson(json)),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue