From 107ae40d2ad0290b2d64e78a73788649678e0ecc Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Tue, 20 Oct 2026 17:02:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(flutter):=20=E7=BB=9F=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E5=88=B7=E6=96=B0=E4=B8=BB=E8=89=B2=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/widgets/app_pull_to_refresh.dart | 13 ++++++------- test/core/app_pull_to_refresh_test.dart | 13 +++++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/core/widgets/app_pull_to_refresh.dart b/lib/core/widgets/app_pull_to_refresh.dart index ba5ac26..b71c335 100644 --- a/lib/core/widgets/app_pull_to_refresh.dart +++ b/lib/core/widgets/app_pull_to_refresh.dart @@ -173,15 +173,14 @@ class _AppPullToRefreshState extends State { child: Icon( Icons.arrow_downward_rounded, size: 18, - color: armed ? AppColors.blue : AppColors.muted, + color: AppColors.blue, ), ), armed ? l10n.releaseToRefresh : l10n.pullToRefresh, - emphasized: armed, ); } - Widget _label(Widget icon, String text, {bool emphasized = false}) { + Widget _label(Widget icon, String text) { return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -189,10 +188,10 @@ class _AppPullToRefreshState extends State { const SizedBox(width: 6), Text( text, - style: TextStyle( - color: emphasized ? AppColors.blue : AppColors.muted, - fontSize: 12, - fontWeight: emphasized ? FontWeight.w700 : FontWeight.w500, + style: const TextStyle( + color: AppColors.blue, + fontSize: 13, + fontWeight: FontWeight.w600, ), ), ], diff --git a/test/core/app_pull_to_refresh_test.dart b/test/core/app_pull_to_refresh_test.dart index 7a55e00..deb4df4 100644 --- a/test/core/app_pull_to_refresh_test.dart +++ b/test/core/app_pull_to_refresh_test.dart @@ -4,6 +4,7 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:fruitshorts/core/theme/app_colors.dart'; import 'package:fruitshorts/core/widgets/app_pull_to_refresh.dart'; import 'package:fruitshorts/l10n/app_localizations.dart'; @@ -43,14 +44,26 @@ void main() { ); expect(scrollable.position.pixels, lessThan(0)); expect(find.text('Pull to refresh'), findsOneWidget); + expect( + tester.widget(find.text('Pull to refresh')).style?.color, + AppColors.blue, + ); await gesture.moveBy(const Offset(0, 120)); await tester.pump(); expect(find.text('Release to refresh'), findsOneWidget); + expect( + tester.widget(find.text('Release to refresh')).style?.color, + AppColors.blue, + ); await gesture.up(); await tester.pump(); expect(find.text('Refreshing…'), findsOneWidget); + expect( + tester.widget(find.text('Refreshing…')).style?.color, + AppColors.blue, + ); expect(calls, 1); final duplicate = await tester.startGesture(