merge: 合并下拉刷新主色文案修正
This commit is contained in:
commit
3041849344
2 files changed
+19
-7
No files matched your search
@@ -173,15 +173,14 @@ class _AppPullToRefreshState extends State<AppPullToRefresh> {
|
||||
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<AppPullToRefresh> {
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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<Text>(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<Text>(find.text('Release to refresh')).style?.color,
|
||||
AppColors.blue,
|
||||
);
|
||||
|
||||
await gesture.up();
|
||||
await tester.pump();
|
||||
expect(find.text('Refreshing…'), findsOneWidget);
|
||||
expect(
|
||||
tester.widget<Text>(find.text('Refreshing…')).style?.color,
|
||||
AppColors.blue,
|
||||
);
|
||||
expect(calls, 1);
|
||||
|
||||
final duplicate = await tester.startGesture(
|
||||
|
||||
Reference in new issue
Block a user