Make code more readable

This commit is contained in:
Ming Ming 2023-12-08 00:10:11 +08:00
parent 05f7ecf55f
commit 3229c014bf

View file

@ -51,8 +51,11 @@ class ByAccount {
} }
class AccountFileRowIds { class AccountFileRowIds {
const AccountFileRowIds( const AccountFileRowIds({
this.accountFileRowId, this.accountRowId, this.fileRowId); required this.accountFileRowId,
required this.accountRowId,
required this.fileRowId,
});
final int accountFileRowId; final int accountFileRowId;
final int accountRowId; final int accountRowId;
@ -173,9 +176,9 @@ extension SqliteDbExtension on SqliteDb {
}); });
return query return query
.map((r) => AccountFileRowIds( .map((r) => AccountFileRowIds(
r.read(accountFiles.rowId)!, accountFileRowId: r.read(accountFiles.rowId)!,
r.read(accountFiles.account)!, accountRowId: r.read(accountFiles.account)!,
r.read(accountFiles.file)!, fileRowId: r.read(accountFiles.file)!,
)) ))
.getSingleOrNull(); .getSingleOrNull();
} }
@ -206,9 +209,9 @@ extension SqliteDbExtension on SqliteDb {
.map((r) => MapEntry( .map((r) => MapEntry(
r.read(files.fileId)!, r.read(files.fileId)!,
AccountFileRowIds( AccountFileRowIds(
r.read(accountFiles.rowId)!, accountFileRowId: r.read(accountFiles.rowId)!,
r.read(accountFiles.account)!, accountRowId: r.read(accountFiles.account)!,
r.read(accountFiles.file)!, fileRowId: r.read(accountFiles.file)!,
), ),
)) ))
.get() .get()