feat(client): 库存列表收尾——副标/toolbar 间距/移动端 golden

- 副标(还原原型 .head .sub):KPI 上方「共 N 个商品 · 数据实时」(千分位)
- toolbar 间距 token 化:搜索框对齐原型 240,间隔走 AppDims.sp2/sp3
- 移动端 golden:窄屏(390)卡片流路径 ×三主题入回归闸
- 顺带修 DataTableCard 分页条窄屏横向溢出(mobile 隐藏每页选择器,
  golden 闸抓出的预存 bug)

analyze 0 error · flutter test +175(库存桌面/移动各 3 golden 全过)。

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 12:11:17 +08:00
parent e1a4fec22b
commit 1632f5f1d9
9 changed files with 49 additions and 19 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

@@ -1,4 +1,5 @@
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/core/models/page_result.dart';
@@ -70,20 +71,32 @@ class _FakeSpecNotifier extends ProductSpecListNotifier {
Future<List<ProductSpecOption>> build() async => const [];
}
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
SharedPreferences.setMockInitialValues({});
goldenAcrossThemes(
'inventory list 整屏',
goldenPrefix: 'inventory_list',
child: () => const Scaffold(body: InventoryListScreen()),
overrides: () => [
List<Override> _overrides() => [
inventoryListProvider.overrideWith(() => _FakeInvNotifier()),
productSeriesListProvider.overrideWith(() => _FakeSeriesNotifier()),
productSpecListProvider.overrideWith(() => _FakeSpecNotifier()),
isReadonlyProvider.overrideWithValue(false),
],
];
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
SharedPreferences.setMockInitialValues({});
// 桌面:宽屏表格路径
goldenAcrossThemes(
'inventory list 整屏(桌面)',
goldenPrefix: 'inventory_list',
child: () => const Scaffold(body: InventoryListScreen()),
overrides: _overrides,
logical: const Size(1280, 900),
);
// 移动:窄屏(<600)→ context.isMobile → MobileListCard 卡片流路径
goldenAcrossThemes(
'inventory list 整屏(移动)',
goldenPrefix: 'inventory_list_mobile',
child: () => const Scaffold(body: InventoryListScreen()),
overrides: _overrides,
logical: const Size(390, 1400),
);
}