style(empty): 放大空状态图标并降低亮度

This commit is contained in:
Zhou Weidong committed 2026-10-23 01:10:59 +08:00
1 parent f206977ad8
commit 44d3bcba18
2 files changed
+9 -10

No files matched your search

+4 -4
View File
@@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
import '../theme/app_colors.dart';
import '../theme/app_dimens.dart';
const double _regularIconSize = 48;
const double _compactIconSize = 32;
const double _regularIconSize = 72;
const double _compactIconSize = 44;
const double _maxContentWidth = 260;
const double _regularHorizontal = 24;
const double _regularVertical = 28;
@@ -78,7 +78,7 @@ class EmptyState extends StatelessWidget {
}
}
/// 空状态只留一枚图标,不加水印底和描边。
/// 空列表只放一枚大图标,不画线框,也不铺底色。
class _EmptyMark extends StatelessWidget {
const _EmptyMark({required this.icon, required this.compact});
@@ -91,7 +91,7 @@ class _EmptyMark extends StatelessWidget {
icon,
key: const Key('empty-state-icon'),
size: compact ? _compactIconSize : _regularIconSize,
color: AppColors.blueSoft,
color: AppColors.subtle,
);
}
}
+5 -6
View File
@@ -23,17 +23,16 @@ void main() {
);
expect(find.byKey(const Key('empty-state-art')), findsNothing);
expect(find.byKey(const Key('empty-state-art-inner')), findsNothing);
expect(find.byKey(const Key('empty-state-icon')), findsOneWidget);
expect(find.text('No stories'), findsOneWidget);
expect(find.text('New content will appear here.'), findsOneWidget);
expect(
tester.getSize(find.byKey(const Key('empty-state-icon'))),
const Size(48, 48),
const Size(72, 72),
);
expect(
tester.widget<Icon>(find.byKey(const Key('empty-state-icon'))).color,
AppColors.blueSoft,
AppColors.subtle,
);
expect(
tester
@@ -84,7 +83,7 @@ void main() {
expect(
tester.getSize(find.byKey(const Key('empty-state-icon'))),
const Size(32, 32),
const Size(44, 44),
);
expect(find.byType(DecoratedBox), findsNothing);
expect(
@@ -111,7 +110,7 @@ void main() {
);
expect(
tester.widget<Icon>(find.byKey(const Key('empty-state-icon'))).color,
AppColors.blueSoft,
AppColors.subtle,
);
await _pump(
@@ -121,7 +120,7 @@ void main() {
);
expect(
tester.widget<Icon>(find.byKey(const Key('empty-state-icon'))).color,
AppColors.blueSoft,
AppColors.subtle,
);
});