style(mine): 重构紧凑 VIP 会员入口
This commit is contained in:
1 parent
9ef78ad670
commit
6ef5429a52
7 files changed
+155
-178
No files matched your search
@@ -173,10 +173,10 @@ void main() {
|
||||
AppColors.vipCardMiddle,
|
||||
AppColors.vipCardEnd,
|
||||
]);
|
||||
expect(vipDecoration.border, isNotNull);
|
||||
expect(vipDecoration.border, isNull);
|
||||
expect(vipDecoration.boxShadow, isNotEmpty);
|
||||
|
||||
// 卡片高度由内容撑开,上下内边距必须一致(边框各占 1pt)。
|
||||
// 卡片高度由内容撑开,身份头部与底部 CTA 都保留安全内边距。
|
||||
final vipRect = tester.getRect(find.byKey(const Key('mine-vip')));
|
||||
final emblemRect = tester.getRect(find.byKey(const Key('mine-vip-emblem')));
|
||||
final benefitsRect = tester.getRect(
|
||||
@@ -184,12 +184,12 @@ void main() {
|
||||
);
|
||||
final topInset = emblemRect.top - vipRect.top;
|
||||
final bottomInset = vipRect.bottom - benefitsRect.bottom;
|
||||
expect(topInset, closeTo(bottomInset, 0.01));
|
||||
expect(topInset, greaterThanOrEqualTo(AppDimens.mineVipPadding));
|
||||
expect(bottomInset, greaterThanOrEqualTo(AppDimens.mineVipPadding));
|
||||
expect(find.byKey(const Key('mine-vip-emblem')), findsOneWidget);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('mine-vip-open'))).height,
|
||||
greaterThanOrEqualTo(AppDimens.tapTarget),
|
||||
greaterThanOrEqualTo(AppDimens.mineVipButtonHeight),
|
||||
);
|
||||
const benefitKeys = [
|
||||
Key('mine-vip-benefit-0'),
|
||||
@@ -200,10 +200,18 @@ void main() {
|
||||
final benefitTops = benefitKeys
|
||||
.map((key) => tester.getTopLeft(find.byKey(key)))
|
||||
.toList();
|
||||
expect(benefitTops.map((position) => position.dy).toSet(), hasLength(1));
|
||||
expect(
|
||||
benefitTops.map((position) => position.dx).toSet(),
|
||||
hasLength(benefitKeys.length),
|
||||
benefitTops.take(2).map((position) => position.dy).toSet(),
|
||||
hasLength(1),
|
||||
);
|
||||
expect(
|
||||
benefitTops.skip(2).map((position) => position.dy).toSet(),
|
||||
hasLength(1),
|
||||
);
|
||||
expect(benefitTops[2].dy, greaterThan(benefitTops[0].dy));
|
||||
expect(
|
||||
benefitTops.take(2).map((position) => position.dx).toSet(),
|
||||
hasLength(2),
|
||||
);
|
||||
|
||||
final order = [
|
||||
|
||||
Reference in new issue
Block a user