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:
@@ -546,27 +546,27 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
|||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 12, vertical: 10),
|
horizontal: 12, vertical: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFFFFF8E1),
|
color: context.tokens.warnBg,
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: const Color(0xFFF57F17)
|
color:
|
||||||
.withAlpha(120)),
|
context.tokens.warn.withAlpha(120)),
|
||||||
),
|
),
|
||||||
child: const Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.wifi_off,
|
Icon(Icons.wifi_off,
|
||||||
color: Color(0xFFF57F17), size: 16),
|
color: context.tokens.warn, size: 16),
|
||||||
SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'服务器不可达,请检查网络连接',
|
'服务器不可达,请检查网络连接',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Color(0xFF5D4037),
|
color: context.tokens.warn,
|
||||||
fontSize: 13),
|
fontSize: 13),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
NetworkRetryButton(
|
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 |
@@ -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),
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user