Files
BudgetApp/lib/models/transaction_record.g.dart
T
Sanders 8b75299d41 Refactors data repositories for single-user mode
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
2025-07-12 21:54:00 +03:00

63 lines
1.6 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'transaction_record.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class TransactionRecordAdapter extends TypeAdapter<TransactionRecord> {
@override
final typeId = 1002;
@override
TransactionRecord read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return TransactionRecord(
id: fields[0] as String?,
category: fields[1] as Category,
tag: fields[2] as Tag?,
amount: (fields[3] as num).toDouble(),
dateTime: fields[4] as DateTime,
vendor: fields[5] as String,
currency: fields[6] as String,
updatedAt: fields[8] as DateTime?,
);
}
@override
void write(BinaryWriter writer, TransactionRecord obj) {
writer
..writeByte(8)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.category)
..writeByte(2)
..write(obj.tag)
..writeByte(3)
..write(obj.amount)
..writeByte(4)
..write(obj.dateTime)
..writeByte(5)
..write(obj.vendor)
..writeByte(6)
..write(obj.currency)
..writeByte(8)
..write(obj.updatedAt);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is TransactionRecordAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}