From 44d3bcba186af47638ef8a3ee7d40b5dcc783f2c Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Fri, 23 Oct 2026 01:10:59 +0800 Subject: [PATCH] =?UTF-8?q?style(empty):=20=E6=94=BE=E5=A4=A7=E7=A9=BA?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=9B=BE=E6=A0=87=E5=B9=B6=E9=99=8D=E4=BD=8E?= =?UTF-8?q?=E4=BA=AE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/widgets/empty_state.dart | 8 ++++---- test/empty_state/empty_state_test.dart | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/core/widgets/empty_state.dart b/lib/core/widgets/empty_state.dart index 08eac68..d650459 100644 --- a/lib/core/widgets/empty_state.dart +++ b/lib/core/widgets/empty_state.dart @@ -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, ); } } diff --git a/test/empty_state/empty_state_test.dart b/test/empty_state/empty_state_test.dart index 8c56f39..1c32c9d 100644 --- a/test/empty_state/empty_state_test.dart +++ b/test/empty_state/empty_state_test.dart @@ -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(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(find.byKey(const Key('empty-state-icon'))).color, - AppColors.blueSoft, + AppColors.subtle, ); await _pump( @@ -121,7 +120,7 @@ void main() { ); expect( tester.widget(find.byKey(const Key('empty-state-icon'))).color, - AppColors.blueSoft, + AppColors.subtle, ); });