diff --git a/docs/plans/PROGRESS.md b/docs/plans/PROGRESS.md index 1d91fd3..aaa039f 100644 --- a/docs/plans/PROGRESS.md +++ b/docs/plans/PROGRESS.md @@ -1240,4 +1240,5 @@ $ flutter test - 追剧保持三列网格,播放历史改为左封面右信息的单列列表,行距 16。 - 历史卡片补充 96×128 封面、观看进度、已看百分比、继续观看和编辑删除。 +- 追剧加号卡片移到全部追剧卡片之后,空列表时仍在左上角。 - 刷新、分页与各页独立滚动位置保持;`flutter analyze`:No issues found。 diff --git a/lib/pages/following/following_page.dart b/lib/pages/following/following_page.dart index e1d99ec..250db53 100644 --- a/lib/pages/following/following_page.dart +++ b/lib/pages/following/following_page.dart @@ -269,10 +269,10 @@ class _FavoritesGrid extends StatelessWidget { itemCount: controller.cards.length + 1, empty: const SizedBox.shrink(), itemBuilder: (context, index) { - if (index == 0) { + if (index == controller.cards.length) { return FollowingAddCard(onTap: onGoHome); } - final drama = controller.cards[index - 1]; + final drama = controller.cards[index]; final episode = drama.episodes.isEmpty ? 1 : drama.episodes.first.number; diff --git a/test/following/following_page_test.dart b/test/following/following_page_test.dart index d534ea4..ff0f371 100644 --- a/test/following/following_page_test.dart +++ b/test/following/following_page_test.dart @@ -116,6 +116,12 @@ void main() { tester.getTopLeft(titleFinder).dx, tester.getTopLeft(coverFinder).dx, ); + expect( + tester.getTopLeft(card).dx, + lessThan( + tester.getTopLeft(find.byKey(const Key('following-add-card'))).dx, + ), + ); await tester.tap(find.byKey(const Key('following-edit'))); await tester.pumpAndSettle();