This commit refactors the data repositories to remove user-specific filtering. It simplifies the data access logic by retrieving all data from the Hive boxes and removing the need to filter by `userId` in the repository methods. This change makes the app function in single-user mode and removes the need to manage multiple user contexts within the data layer. Specifically: - Removes `userId` parameter from repository methods. - Updates the setting repository to use fixed keys. - Removes user ID filtering from queries. - Removes user ID parameters from Cubits and Blocs - Updates initial data creation
51 lines
1.4 KiB
Dart
51 lines
1.4 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'app_settings.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
class AppSettingsAdapter extends TypeAdapter<AppSettings> {
|
|
@override
|
|
final typeId = 1005;
|
|
|
|
@override
|
|
AppSettings read(BinaryReader reader) {
|
|
final numOfFields = reader.readByte();
|
|
final fields = <int, dynamic>{
|
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
|
};
|
|
return AppSettings(
|
|
languageCode: fields[1] == null ? 'ru' : fields[1] as String,
|
|
isDarkMode: fields[2] == null ? false : fields[2] as bool,
|
|
defaultCurrency: fields[3] == null ? 'RUB' : fields[3] as String,
|
|
updatedAt: fields[4] as DateTime?,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, AppSettings obj) {
|
|
writer
|
|
..writeByte(4)
|
|
..writeByte(1)
|
|
..write(obj.languageCode)
|
|
..writeByte(2)
|
|
..write(obj.isDarkMode)
|
|
..writeByte(3)
|
|
..write(obj.defaultCurrency)
|
|
..writeByte(4)
|
|
..write(obj.updatedAt);
|
|
}
|
|
|
|
@override
|
|
int get hashCode => typeId.hashCode;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is AppSettingsAdapter &&
|
|
runtimeType == other.runtimeType &&
|
|
typeId == other.typeId;
|
|
}
|