fix(home): 调整搜索栏右侧入口样式
This commit is contained in:
1 parent
acae05d354
commit
909762ac3b
5 files changed
+66
-8
No files matched your search
@@ -9,6 +9,7 @@ import 'package:fruitshorts/core/data/repositories/favorite_repository.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/playback_repository.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/watch_history_repository.dart';
|
||||
import 'package:fruitshorts/core/theme/app_colors.dart';
|
||||
import 'package:fruitshorts/core/theme/app_dimens.dart';
|
||||
import 'package:fruitshorts/core/widgets/app_bottom_nav.dart';
|
||||
import 'package:fruitshorts/pages/following/following_page.dart';
|
||||
import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart';
|
||||
@@ -50,6 +51,57 @@ void main() {
|
||||
}
|
||||
expect(find.byKey(const Key('home-wallet-entry')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-wallet-badge')), findsOneWidget);
|
||||
final searchEntry = find.byKey(const Key('home-search-entry'));
|
||||
final vipEntry = find.byKey(const Key('home-vip-entry'));
|
||||
final walletEntry = find.byKey(const Key('home-wallet-entry'));
|
||||
expect(
|
||||
tester.getSize(vipEntry),
|
||||
const Size.square(AppDimens.homeActionSlot),
|
||||
);
|
||||
expect(
|
||||
tester.getSize(walletEntry),
|
||||
const Size.square(AppDimens.homeActionSlot),
|
||||
);
|
||||
expect(
|
||||
tester.getCenter(vipEntry).dy,
|
||||
closeTo(tester.getCenter(searchEntry).dy, 0.1),
|
||||
);
|
||||
expect(
|
||||
tester.getCenter(walletEntry).dy,
|
||||
closeTo(tester.getCenter(searchEntry).dy, 0.1),
|
||||
);
|
||||
expect(
|
||||
tester.getTopLeft(walletEntry).dx - tester.getTopRight(vipEntry).dx,
|
||||
AppDimens.homeActionGap,
|
||||
);
|
||||
expect(
|
||||
tester.getTopRight(walletEntry).dx,
|
||||
closeTo(390 - AppDimens.feedPageHorizontal, 0.1),
|
||||
);
|
||||
final crown = tester.widget<Icon>(
|
||||
find.descendant(
|
||||
of: vipEntry,
|
||||
matching: find.byIcon(Icons.workspace_premium_outlined),
|
||||
),
|
||||
);
|
||||
final gift = tester.widget<Icon>(
|
||||
find.descendant(
|
||||
of: walletEntry,
|
||||
matching: find.byIcon(Icons.card_giftcard_rounded),
|
||||
),
|
||||
);
|
||||
expect(crown.size, AppDimens.homeActionIcon);
|
||||
expect(crown.color, AppColors.homeCrownGold);
|
||||
expect(gift.size, AppDimens.homeActionIcon);
|
||||
expect(gift.color, AppColors.homeGiftPink);
|
||||
expect(
|
||||
tester
|
||||
.widget<Material>(
|
||||
find.ancestor(of: vipEntry, matching: find.byType(Material)).first,
|
||||
)
|
||||
.color,
|
||||
AppColors.transparent,
|
||||
);
|
||||
expect(find.byKey(const Key('mine-mini-player')), findsNothing);
|
||||
expect(find.byType(FloatingActionButton), findsNothing);
|
||||
for (final key in _keys.skip(1)) {
|
||||
|
||||
Reference in new issue
Block a user