feat(flutter): 接入分类记录收藏与下载授权

This commit is contained in:
Zhou Weidong committed 2026-10-17 14:49:16 +08:00
1 parent 00280ca0da
commit cc4d7c5a9d
52 files changed
+4440 -171

No files matched your search

+14 -9
View File
@@ -9,6 +9,7 @@ import 'package:shared_preferences_platform_interface/in_memory_shared_preferenc
import 'package:shared_preferences_platform_interface/shared_preferences_async_platform_interface.dart';
import 'support/fake_catalog.dart';
import 'support/fake_category.dart';
import 'support/widget_player.dart';
import 'package:fruitshorts/core/data/repositories/favorite_repository.dart';
import 'package:fruitshorts/core/data/repositories/catalog_repository.dart';
@@ -39,15 +40,19 @@ void main() {
Widget appUnderTest({
PlayerFactory? playerFactory,
CatalogRepository? catalogRepository,
}) => LumaDramaApp(
playerFactory: playerFactory ?? createWidgetPlayer,
catalogRepository: catalogRepository ?? FakeCatalogRepository(),
watchHistoryRepository: InMemoryWatchHistoryRepository(),
favoriteRepository: InMemoryFavoriteRepository(
cards: FakeCatalogRepository().dramas,
),
playbackRepository: FakePlaybackRepository(),
);
}) {
final catalog = catalogRepository ?? FakeCatalogRepository();
return LumaDramaApp(
playerFactory: playerFactory ?? createWidgetPlayer,
catalogRepository: catalog,
categoryRepository: FakeCategoryRepository(catalog: catalog),
watchHistoryRepository: InMemoryWatchHistoryRepository(),
favoriteRepository: InMemoryFavoriteRepository(
cards: FakeCatalogRepository().dramas,
),
playbackRepository: FakePlaybackRepository(),
);
}
testWidgets(
'should_promote_next_without_recreating_it_or_showing_loading_when_home_is_swiped',