upgrade min sdk; run formatter

This commit is contained in:
Fabian Freund
2025-06-02 22:25:10 +02:00
parent 8fccd767af
commit ad03cc9bac
171 changed files with 4817 additions and 4685 deletions
@@ -44,9 +44,8 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
return db.transaction(() async {
await Future.wait(
articles.map((newArticle) {
final statement =
db.article.update()
..where((article) => article.id.equals(newArticle.id));
final statement = db.article.update()
..where((article) => article.id.equals(newArticle.id));
return statement.write(
ArticleCompanion(
@@ -86,12 +85,11 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
updated: Value(article.updated),
);
},
where:
(old) =>
old.updated.isNotNull() &
old.updated.isSmallerThanValue(
article.updated ?? DateTime(0),
),
where: (old) =>
old.updated.isNotNull() &
old.updated.isSmallerThanValue(
article.updated ?? DateTime(0),
),
),
),
)
@@ -101,8 +99,8 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
}
Future<int> updateArticleRead(String articleId, DateTime? read) {
final statement =
db.article.update()..where((article) => article.id.equals(articleId));
final statement = db.article.update()
..where((article) => article.id.equals(articleId));
return statement.write(ArticleCompanion(lastRead: Value(read)));
}
@@ -110,15 +108,14 @@ class ArticleDao extends DatabaseAccessor<FeedDatabase> with _$ArticleDaoMixin {
Selectable<(String, int)> getUnreadArticleCount() {
final count = countAll();
final countByFeed =
db.article.selectOnly()
..addColumns([db.article.feedId, count])
..where(
db.article.lastRead.isNull() |
(db.article.updated.isNotNull() &
db.article.lastRead.isSmallerThan(db.article.lastRead)),
)
..groupBy([db.article.feedId]);
final countByFeed = db.article.selectOnly()
..addColumns([db.article.feedId, count])
..where(
db.article.lastRead.isNull() |
(db.article.updated.isNotNull() &
db.article.lastRead.isSmallerThan(db.article.lastRead)),
)
..groupBy([db.article.feedId]);
return countByFeed.map(
(result) => (result.read(db.article.feedId)!, result.read(count)!),
@@ -16,8 +16,8 @@ class FeedDao extends DatabaseAccessor<FeedDatabase> with _$FeedDaoMixin {
}
Future<int> updateFeedFetched(Uri feedId, DateTime fetched) {
final statement =
db.feed.update()..where((feed) => feed.url.equalsValue(feedId));
final statement = db.feed.update()
..where((feed) => feed.url.equalsValue(feedId));
return statement.write(FeedCompanion(lastFetched: Value(fetched)));
}