merge: 合并 K32-A 识别入口移除
This commit is contained in:
commit
698fb12e07
12 files changed
+9
-84
No files matched your search
@@ -30,7 +30,6 @@
|
|||||||
"actionGenre": "Action",
|
"actionGenre": "Action",
|
||||||
"filter": "Filter",
|
"filter": "Filter",
|
||||||
"reserve": "Reserve",
|
"reserve": "Reserve",
|
||||||
"identifyDrama": "Identify",
|
|
||||||
"heatLabel": "{count} heat",
|
"heatLabel": "{count} heat",
|
||||||
"@heatLabel": {
|
"@heatLabel": {
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
"actionGenre": "Aksi",
|
"actionGenre": "Aksi",
|
||||||
"filter": "Filter",
|
"filter": "Filter",
|
||||||
"reserve": "Reservasi",
|
"reserve": "Reservasi",
|
||||||
"identifyDrama": "Identifikasi",
|
|
||||||
"heatLabel": "{count} panas",
|
"heatLabel": "{count} panas",
|
||||||
"topCharts": "Peringkat Teratas",
|
"topCharts": "Peringkat Teratas",
|
||||||
"newReleases": "Rilisan Baru",
|
"newReleases": "Rilisan Baru",
|
||||||
|
|||||||
@@ -280,12 +280,6 @@ abstract class AppLocalizations {
|
|||||||
/// **'Reserve'**
|
/// **'Reserve'**
|
||||||
String get reserve;
|
String get reserve;
|
||||||
|
|
||||||
/// No description provided for @identifyDrama.
|
|
||||||
///
|
|
||||||
/// In en, this message translates to:
|
|
||||||
/// **'Identify'**
|
|
||||||
String get identifyDrama;
|
|
||||||
|
|
||||||
/// No description provided for @heatLabel.
|
/// No description provided for @heatLabel.
|
||||||
///
|
///
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
|
|||||||
@@ -101,9 +101,6 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get reserve => 'Reserve';
|
String get reserve => 'Reserve';
|
||||||
|
|
||||||
@override
|
|
||||||
String get identifyDrama => 'Identify';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String heatLabel(String count) {
|
String heatLabel(String count) {
|
||||||
return '$count heat';
|
return '$count heat';
|
||||||
|
|||||||
@@ -101,9 +101,6 @@ class AppLocalizationsId extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get reserve => 'Reservasi';
|
String get reserve => 'Reservasi';
|
||||||
|
|
||||||
@override
|
|
||||||
String get identifyDrama => 'Identifikasi';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String heatLabel(String count) {
|
String heatLabel(String count) {
|
||||||
return '$count panas';
|
return '$count panas';
|
||||||
|
|||||||
@@ -98,9 +98,6 @@ class AppLocalizationsZh extends AppLocalizations {
|
|||||||
@override
|
@override
|
||||||
String get reserve => '预约';
|
String get reserve => '预约';
|
||||||
|
|
||||||
@override
|
|
||||||
String get identifyDrama => '识剧';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String heatLabel(String count) {
|
String heatLabel(String count) {
|
||||||
return '$count热度';
|
return '$count热度';
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
"actionGenre": "动作",
|
"actionGenre": "动作",
|
||||||
"filter": "筛选",
|
"filter": "筛选",
|
||||||
"reserve": "预约",
|
"reserve": "预约",
|
||||||
"identifyDrama": "识剧",
|
|
||||||
"heatLabel": "{count}热度",
|
"heatLabel": "{count}热度",
|
||||||
"topCharts": "排行榜",
|
"topCharts": "排行榜",
|
||||||
"newReleases": "新剧",
|
"newReleases": "新剧",
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
|||||||
focusNode: logic.searchFocus,
|
focusNode: logic.searchFocus,
|
||||||
onChanged: (_) => logic.onSearchChanged(),
|
onChanged: (_) => logic.onSearchChanged(),
|
||||||
loading: logic.searchLoading,
|
loading: logic.searchLoading,
|
||||||
onIdentify: () => _showComingSoon(l10n),
|
|
||||||
),
|
),
|
||||||
Expanded(child: _feed(l10n, categories)),
|
Expanded(child: _feed(l10n, categories)),
|
||||||
if (!embedded) _bottomNav(l10n),
|
if (!embedded) _bottomNav(l10n),
|
||||||
|
|||||||
@@ -13,14 +13,12 @@ class DiscoverHeader extends StatelessWidget {
|
|||||||
required this.focusNode,
|
required this.focusNode,
|
||||||
required this.onChanged,
|
required this.onChanged,
|
||||||
required this.loading,
|
required this.loading,
|
||||||
required this.onIdentify,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
final TextEditingController controller;
|
final TextEditingController controller;
|
||||||
final FocusNode focusNode;
|
final FocusNode focusNode;
|
||||||
final ValueChanged<String> onChanged;
|
final ValueChanged<String> onChanged;
|
||||||
final bool loading;
|
final bool loading;
|
||||||
final VoidCallback onIdentify;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -32,7 +30,6 @@ class DiscoverHeader extends StatelessWidget {
|
|||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
loading: loading,
|
loading: loading,
|
||||||
onIdentify: onIdentify,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,13 +3,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../../core/theme/app_colors.dart';
|
import '../../../core/theme/app_colors.dart';
|
||||||
import '../../../core/theme/app_dimens.dart';
|
|
||||||
import '../../../l10n/app_localizations.dart';
|
import '../../../l10n/app_localizations.dart';
|
||||||
|
|
||||||
const double _searchHeight = 40;
|
const double _searchHeight = 40;
|
||||||
const double _searchRadius = 18;
|
const double _searchRadius = 18;
|
||||||
|
|
||||||
/// 剧场顶部搜索框:右侧内嵌「识剧」入口。
|
/// 剧场顶部整行搜索框。
|
||||||
class DiscoverSearchField extends StatelessWidget {
|
class DiscoverSearchField extends StatelessWidget {
|
||||||
const DiscoverSearchField({
|
const DiscoverSearchField({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -17,7 +16,6 @@ class DiscoverSearchField extends StatelessWidget {
|
|||||||
required this.focusNode,
|
required this.focusNode,
|
||||||
required this.onChanged,
|
required this.onChanged,
|
||||||
required this.loading,
|
required this.loading,
|
||||||
required this.onIdentify,
|
|
||||||
this.horizontalPadding = 14,
|
this.horizontalPadding = 14,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -25,7 +23,6 @@ class DiscoverSearchField extends StatelessWidget {
|
|||||||
final FocusNode focusNode;
|
final FocusNode focusNode;
|
||||||
final ValueChanged<String> onChanged;
|
final ValueChanged<String> onChanged;
|
||||||
final bool loading;
|
final bool loading;
|
||||||
final VoidCallback onIdentify;
|
|
||||||
final double horizontalPadding;
|
final double horizontalPadding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -53,17 +50,14 @@ class DiscoverSearchField extends StatelessWidget {
|
|||||||
color: AppColors.subtle,
|
color: AppColors.subtle,
|
||||||
size: 17,
|
size: 17,
|
||||||
),
|
),
|
||||||
suffixIcon: Padding(
|
suffixIcon: loading
|
||||||
padding: const EdgeInsets.only(right: 6),
|
? const SizedBox.square(
|
||||||
child: loading
|
dimension: 18,
|
||||||
? const SizedBox.square(
|
child: Center(
|
||||||
dimension: 18,
|
child: CircularProgressIndicator(strokeWidth: 2),
|
||||||
child: Center(
|
),
|
||||||
child: CircularProgressIndicator(strokeWidth: 2),
|
)
|
||||||
),
|
: null,
|
||||||
)
|
|
||||||
: _identifyPill(context),
|
|
||||||
),
|
|
||||||
suffixIconConstraints: const BoxConstraints(
|
suffixIconConstraints: const BoxConstraints(
|
||||||
minWidth: 0,
|
minWidth: 0,
|
||||||
minHeight: 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-category-chips')), findsOneWidget);
|
||||||
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
|
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
|
||||||
expect(find.byKey(const Key('home-all-dramas-grid')), findsOneWidget);
|
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);
|
expect(find.byKey(const Key('discover-profile')), findsNothing);
|
||||||
for (final tool in ['filter', 'ranking', 'new', 'reserve']) {
|
for (final tool in ['filter', 'ranking', 'new', 'reserve']) {
|
||||||
expect(find.byKey(Key('theater-toolbar-$tool')), findsOneWidget);
|
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', (
|
testWidgets('should_filter_grid_when_category_chip_is_tapped', (
|
||||||
tester,
|
tester,
|
||||||
) async {
|
) async {
|
||||||
|
|||||||
@@ -215,7 +215,6 @@ void main() {
|
|||||||
expect(find.byKey(const Key('theater-category-chips')), findsOneWidget);
|
expect(find.byKey(const Key('theater-category-chips')), findsOneWidget);
|
||||||
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
|
expect(find.byKey(const Key('theater-language-chips')), findsNothing);
|
||||||
expect(find.byKey(const Key('home-all-dramas-grid')), findsOneWidget);
|
expect(find.byKey(const Key('home-all-dramas-grid')), findsOneWidget);
|
||||||
expect(find.byKey(const Key('discover-identify')), findsOneWidget);
|
|
||||||
expect(tester.takeException(), isNull);
|
expect(tester.takeException(), isNull);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user