refactor(navigation): 移除全局两侧悬浮元素

This commit is contained in:
Zhou Weidong committed 2026-10-22 17:58:43 +08:00
1 parent 5cead7ce00
commit 9cf832b318
8 files changed
+103 -217

No files matched your search

+5 -18
View File
@@ -14,7 +14,6 @@ import 'package:fruitshorts/l10n/app_localizations.dart';
import 'package:fruitshorts/pages/auth/auth_view.dart';
import 'package:fruitshorts/pages/mine/mine_types.dart';
import 'package:fruitshorts/pages/mine/widgets/mine_menu.dart';
import 'package:fruitshorts/pages/player/player_view.dart';
import 'package:fruitshorts/pages/store/vip_page.dart';
import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart';
import 'package:shared_preferences_platform_interface/shared_preferences_async_platform_interface.dart';
@@ -105,7 +104,7 @@ void main() {
expect(find.byType(AuthPage), findsOneWidget);
});
testWidgets('should_render_signed_in_user_and_dismiss_mini_player', (
testWidgets('should_render_signed_in_user_without_floating_mini_player', (
tester,
) async {
await _pumpApp(
@@ -119,17 +118,8 @@ void main() {
expect(find.text('UID: U-100'), findsOneWidget);
expect(find.byKey(const Key('mine-edit')), findsOneWidget);
expect(find.byKey(const Key('mine-login')), findsNothing);
expect(find.byKey(const Key('mine-mini-player')), findsOneWidget);
expect(find.text('Recent drama'), findsOneWidget);
expect(find.text('Episode 3'), findsOneWidget);
expect(
tester.getSize(find.byKey(const Key('mine-mini-player'))),
const Size(AppDimens.mineMiniWidth, AppDimens.mineMiniHeight),
);
await tester.tap(find.byKey(const Key('mine-mini-close')));
await tester.pump();
expect(find.byKey(const Key('mine-mini-player')), findsNothing);
expect(find.byType(FloatingActionButton), findsNothing);
await tester.tap(find.byKey(const Key('mine-edit')));
await tester.pumpAndSettle();
@@ -143,7 +133,7 @@ void main() {
expect(tester.takeException(), isNull);
});
testWidgets('should_open_vip_and_recent_player_from_mine_entries', (
testWidgets('should_open_vip_from_mine_without_floating_player', (
tester,
) async {
await _pumpApp(
@@ -158,11 +148,8 @@ void main() {
expect(find.byType(VipPage), findsOneWidget);
await tester.binding.handlePopRoute();
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('mine-mini-player')));
await tester.pumpAndSettle();
final player = tester.widget<PlayerPage>(find.byType(PlayerPage).last);
expect(player.embedded, isFalse);
expect(find.byKey(const Key('mine-mini-player')), findsNothing);
expect(find.byType(FloatingActionButton), findsNothing);
});
testWidgets('should_expose_seven_menu_destinations_in_order', (tester) async {