feat(app): 客户端展示多语言并支持筛选分页

This commit is contained in:
Zhou Weidong committed 2026-10-24 17:20:24 +08:00
1 parent 8481611372
commit 8b50b5bd06
68 files changed
+2742 -1120

No files matched your search

+9 -4
View File
@@ -176,6 +176,8 @@ class _FavoritesBody extends StatelessWidget {
],
PagedListFooter(
loading: favorites.loadingMore,
hasMore: favorites.hasMore,
hasItems: favorites.cards.isNotEmpty,
errorMessage: favorites.loadMoreError == null
? null
: errorText(l10n, favorites.loadMoreError, l10n.favoritesError),
@@ -265,8 +267,9 @@ class _FavoriteCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
final tags = _tags();
final synopsis = drama.synopsis.trim();
final languageCode = Localizations.localeOf(context).languageCode;
final tags = _tags(languageCode);
final synopsis = drama.localizedSynopsis(languageCode).trim();
return Container(
key: ValueKey('favorite-card-${drama.id}'),
decoration: BoxDecoration(
@@ -309,7 +312,7 @@ class _FavoriteCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
drama.title,
drama.localizedTitle(languageCode),
key: ValueKey('favorite-title-${drama.id}'),
maxLines: 2,
overflow: TextOverflow.ellipsis,
@@ -444,7 +447,9 @@ class _FavoriteCard extends StatelessWidget {
);
}
List<String> _tags() {
List<String> _tags(String languageCode) {
final localized = drama.localizedTypeLabels(languageCode);
if (localized.isNotEmpty) return localized.take(_maxTags).toList();
final values = <String>[];
for (final source in [drama.genre, drama.category]) {
for (final part in source.split(_tagSplitter)) {