fix(flutter): 移除搜索框识剧入口

This commit is contained in:
Zhou Weidong committed 2026-10-20 13:27:03 +08:00
1 parent 5a51af4264
commit 5e2fba1746
12 files changed
+9 -84

No files matched your search

-1
View File
@@ -30,7 +30,6 @@
"actionGenre": "Action",
"filter": "Filter",
"reserve": "Reserve",
"identifyDrama": "Identify",
"heatLabel": "{count} heat",
"@heatLabel": {
"placeholders": {
-1
View File
@@ -30,7 +30,6 @@
"actionGenre": "Aksi",
"filter": "Filter",
"reserve": "Reservasi",
"identifyDrama": "Identifikasi",
"heatLabel": "{count} panas",
"topCharts": "Peringkat Teratas",
"newReleases": "Rilisan Baru",
-6
View File
@@ -280,12 +280,6 @@ abstract class AppLocalizations {
/// **'Reserve'**
String get reserve;
/// No description provided for @identifyDrama.
///
/// In en, this message translates to:
/// **'Identify'**
String get identifyDrama;
/// No description provided for @heatLabel.
///
/// In en, this message translates to:
-3
View File
@@ -101,9 +101,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get reserve => 'Reserve';
@override
String get identifyDrama => 'Identify';
@override
String heatLabel(String count) {
return '$count heat';
-3
View File
@@ -101,9 +101,6 @@ class AppLocalizationsId extends AppLocalizations {
@override
String get reserve => 'Reservasi';
@override
String get identifyDrama => 'Identifikasi';
@override
String heatLabel(String count) {
return '$count panas';
-3
View File
@@ -98,9 +98,6 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get reserve => '预约';
@override
String get identifyDrama => '识剧';
@override
String heatLabel(String count) {
return '$count热度';
-1
View File
@@ -30,7 +30,6 @@
"actionGenre": "动作",
"filter": "筛选",
"reserve": "预约",
"identifyDrama": "识剧",
"heatLabel": "{count}热度",
"topCharts": "排行榜",
"newReleases": "新剧",
-1
View File
@@ -106,7 +106,6 @@ class _DiscoverPageState extends State<DiscoverPage> {
focusNode: logic.searchFocus,
onChanged: (_) => logic.onSearchChanged(),
loading: logic.searchLoading,
onIdentify: () => _showComingSoon(l10n),
),
Expanded(child: _feed(l10n, categories)),
if (!embedded) _bottomNav(l10n),
@@ -13,14 +13,12 @@ class DiscoverHeader extends StatelessWidget {
required this.focusNode,
required this.onChanged,
required this.loading,
required this.onIdentify,
});
final TextEditingController controller;
final FocusNode focusNode;
final ValueChanged<String> onChanged;
final bool loading;
final VoidCallback onIdentify;
@override
Widget build(BuildContext context) {
@@ -32,7 +30,6 @@ class DiscoverHeader extends StatelessWidget {
focusNode: focusNode,
onChanged: onChanged,
loading: loading,
onIdentify: onIdentify,
),
),
);
@@ -3,13 +3,12 @@
import 'package:flutter/material.dart';
import '../../../core/theme/app_colors.dart';
import '../../../core/theme/app_dimens.dart';
import '../../../l10n/app_localizations.dart';
const double _searchHeight = 40;
const double _searchRadius = 18;
/// 剧场顶部搜索框:右侧内嵌「识剧」入口。
/// 剧场顶部整行搜索框。
class DiscoverSearchField extends StatelessWidget {
const DiscoverSearchField({
super.key,
@@ -17,7 +16,6 @@ class DiscoverSearchField extends StatelessWidget {
required this.focusNode,
required this.onChanged,
required this.loading,
required this.onIdentify,
this.horizontalPadding = 14,
});
@@ -25,7 +23,6 @@ class DiscoverSearchField extends StatelessWidget {
final FocusNode focusNode;
final ValueChanged<String> onChanged;
final bool loading;
final VoidCallback onIdentify;
final double horizontalPadding;
@override
@@ -53,17 +50,14 @@ class DiscoverSearchField extends StatelessWidget {
color: AppColors.subtle,
size: 17,
),
suffixIcon: Padding(
padding: const EdgeInsets.only(right: 6),
child: loading
? const SizedBox.square(
dimension: 18,
child: Center(
child: CircularProgressIndicator(strokeWidth: 2),
),
)
: _identifyPill(context),
),
suffixIcon: loading
? const SizedBox.square(
dimension: 18,
child: Center(
child: CircularProgressIndicator(strokeWidth: 2),
),
)
: null,
suffixIconConstraints: const BoxConstraints(
minWidth: 0,
minHeight: 0,
@@ -82,38 +76,4 @@ class DiscoverSearchField extends StatelessWidget {
),
);
}
Widget _identifyPill(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 7),
child: Material(
color: AppColors.raised,
borderRadius: BorderRadius.circular(AppDimens.pillRadius),
child: InkWell(
key: const Key('discover-identify'),
onTap: onIdentify,
borderRadius: BorderRadius.circular(AppDimens.pillRadius),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
Icons.center_focus_weak_rounded,
color: AppColors.muted,
size: 14,
),
const SizedBox(width: 4),
Text(
l10n.identifyDrama,
style: const TextStyle(color: AppColors.muted, fontSize: 12),
),
],
),
),
),
),
);
}
}
@@ -34,7 +34,6 @@ void main() {
expect(find.byKey(const Key('theater-category-chips')), findsOneWidget);
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
expect(find.byKey(const Key('home-all-dramas-grid')), findsOneWidget);
expect(find.byKey(const Key('discover-identify')), findsOneWidget);
expect(find.byKey(const Key('discover-profile')), findsNothing);
for (final tool in ['filter', 'ranking', 'new', 'reserve']) {
expect(find.byKey(Key('theater-toolbar-$tool')), findsOneWidget);
@@ -71,17 +70,6 @@ void main() {
);
});
testWidgets('should_show_coming_soon_when_identify_is_tapped', (
tester,
) async {
await _pumpTheater(tester, categoryRepository: _GridCategoryRepository());
await tester.tap(find.byKey(const Key('discover-identify')));
await tester.pump();
expect(find.text('Coming soon'), findsOneWidget);
});
testWidgets('should_filter_grid_when_category_chip_is_tapped', (
tester,
) async {
-1
View File
@@ -215,7 +215,6 @@ void main() {
expect(find.byKey(const Key('theater-category-chips')), findsOneWidget);
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
expect(find.byKey(const Key('home-all-dramas-grid')), findsOneWidget);
expect(find.byKey(const Key('discover-identify')), findsOneWidget);
expect(tester.takeException(), isNull);
});