feat(client): 登录屏离线提示条 token 化 + 整屏 golden ×三主题

服务器不可达提示条 FFF8E1/F57F17/5D4037 → warnBg/warn;
品牌 hero + 表单整屏 golden 入回归闸(覆盖联网首检避免 Timer 泄漏)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
This commit is contained in:
wangjia
2026-06-25 14:02:58 +08:00
parent a125f9a8d6
commit f70be38361
5 changed files with 35 additions and 8 deletions
+8 -8
View File
@@ -546,27 +546,27 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 10),
decoration: BoxDecoration(
color: const Color(0xFFFFF8E1),
color: context.tokens.warnBg,
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: const Color(0xFFF57F17)
.withAlpha(120)),
color:
context.tokens.warn.withAlpha(120)),
),
child: const Row(
child: Row(
children: [
Icon(Icons.wifi_off,
color: Color(0xFFF57F17), size: 16),
SizedBox(width: 8),
color: context.tokens.warn, size: 16),
const SizedBox(width: 8),
Expanded(
child: Text(
'服务器不可达,请检查网络连接',
style: TextStyle(
color: Color(0xFF5D4037),
color: context.tokens.warn,
fontSize: 13),
),
),
NetworkRetryButton(
foreground: Color(0xFF5D4037)),
foreground: context.tokens.warn),
],
),
),
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

+27
View File
@@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:jiu_client/providers/connectivity_provider.dart';
import 'package:jiu_client/screens/auth/login_screen.dart';
import '../support/golden_harness.dart';
/// design-distill 阶段4:登录屏 golden × 三主题(品牌 hero + 表单)。
/// 锁住品牌 hero、表单、离线提示条(已 token 化)随主题换色。
/// 更新基准:flutter test --update-goldens test/golden/login_golden_test.dart
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
SharedPreferences.setMockInitialValues({});
goldenAcrossThemes(
'login 整屏',
goldenPrefix: 'login',
child: () => const LoginScreen(),
overrides: () => [
// 跳过联网首检,避免后台 Timer 在 golden 结束后仍 pending
connectivityProvider.overrideWith((ref) => ConnectivityNotifier(skipInit: true)),
],
logical: const Size(1280, 860),
);
}