diff --git a/client/lib/screens/inventory/inventory_list_screen.dart b/client/lib/screens/inventory/inventory_list_screen.dart index 7c40307..f4dec06 100644 --- a/client/lib/screens/inventory/inventory_list_screen.dart +++ b/client/lib/screens/inventory/inventory_list_screen.dart @@ -15,6 +15,7 @@ import '../../widgets/write_guard.dart'; import '../../providers/inventory_provider.dart'; import '../../widgets/data_table_card.dart'; import '../../widgets/kpi_card.dart' show StatusPill; // 旧 tab/移动卡片用,待统一 DsBadge +import 'package:lucide_icons_flutter/lucide_icons.dart'; import '../../widgets/ds/ds_atoms.dart'; import '../../widgets/ds/ds_kpi.dart'; import '../../widgets/ds/ds_table.dart'; @@ -646,7 +647,7 @@ class _InventoryListScreenState extends ConsumerState { title: 'SKU 总数', value: NumberFormat.decimalPattern() .format(summary?.skuCount ?? result.total), - icon: Icons.inventory_2, + icon: LucideIcons.box, tone: DsKpiTone.info, delta: '点击清筛选', onTap: () { @@ -666,7 +667,7 @@ class _InventoryListScreenState extends ConsumerState { DsKpi( title: '库存货值', value: summary != null ? yuanWan(summary.stockValue) : '—', - icon: Icons.savings_outlined, + icon: LucideIcons.database, tone: DsKpiTone.ok, delta: '按进价', ), @@ -674,14 +675,14 @@ class _InventoryListScreenState extends ConsumerState { title: '在库数量', value: NumberFormat.decimalPattern() .format((summary?.inStockQty ?? 0).round()), - icon: Icons.warehouse_outlined, + icon: LucideIcons.box, tone: DsKpiTone.blue, delta: '件', ), DsKpi( title: '缺货预警', value: '${summary?.shortageCount ?? 0}', - icon: Icons.error_outline, + icon: LucideIcons.triangleAlert, tone: DsKpiTone.alert, delta: (summary?.warningCount ?? 0) > 0 ? '需补货 ${summary!.warningCount} 项' diff --git a/client/pubspec.lock b/client/pubspec.lock index 81a1cf7..110e76a 100644 --- a/client/pubspec.lock +++ b/client/pubspec.lock @@ -469,6 +469,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + lucide_icons_flutter: + dependency: "direct main" + description: + name: lucide_icons_flutter + sha256: "7c5dc01a32a9905ae34e2d84224e92d6d0c42acf8926df9e01c35a1446bf1b69" + url: "https://pub.dev" + source: hosted + version: "3.1.14+2" matcher: dependency: transitive description: diff --git a/client/pubspec.yaml b/client/pubspec.yaml index 0d3c65a..f59b35c 100644 --- a/client/pubspec.yaml +++ b/client/pubspec.yaml @@ -31,6 +31,7 @@ dependencies: ffi: ^2.1.3 # GBK 编码(TSPL TEXT 内置中文字体需要),支持 macOS/Windows/Linux charset_converter: ^2.1.0 + lucide_icons_flutter: ^3.1.14+2 dev_dependencies: flutter_test: diff --git a/client/test/golden/goldens/inventory_list_a.png b/client/test/golden/goldens/inventory_list_a.png index 500703f..dc214e1 100644 Binary files a/client/test/golden/goldens/inventory_list_a.png and b/client/test/golden/goldens/inventory_list_a.png differ diff --git a/client/test/golden/goldens/inventory_list_b.png b/client/test/golden/goldens/inventory_list_b.png index 8cc460e..e28c197 100644 Binary files a/client/test/golden/goldens/inventory_list_b.png and b/client/test/golden/goldens/inventory_list_b.png differ diff --git a/client/test/golden/goldens/inventory_list_c.png b/client/test/golden/goldens/inventory_list_c.png index 0e61dd7..0c3e1e7 100644 Binary files a/client/test/golden/goldens/inventory_list_c.png and b/client/test/golden/goldens/inventory_list_c.png differ diff --git a/client/test/golden/goldens/inventory_list_mobile_a.png b/client/test/golden/goldens/inventory_list_mobile_a.png index 634e495..11acbc5 100644 Binary files a/client/test/golden/goldens/inventory_list_mobile_a.png and b/client/test/golden/goldens/inventory_list_mobile_a.png differ diff --git a/client/test/golden/goldens/inventory_list_mobile_b.png b/client/test/golden/goldens/inventory_list_mobile_b.png index 0598438..5c91def 100644 Binary files a/client/test/golden/goldens/inventory_list_mobile_b.png and b/client/test/golden/goldens/inventory_list_mobile_b.png differ diff --git a/client/test/golden/goldens/inventory_list_mobile_c.png b/client/test/golden/goldens/inventory_list_mobile_c.png index 6437c03..746508a 100644 Binary files a/client/test/golden/goldens/inventory_list_mobile_c.png and b/client/test/golden/goldens/inventory_list_mobile_c.png differ diff --git a/client/test/support/golden_harness.dart b/client/test/support/golden_harness.dart index 79c4efc..8cb7b8d 100644 --- a/client/test/support/golden_harness.dart +++ b/client/test/support/golden_harness.dart @@ -27,6 +27,14 @@ Future ensureGoldenFonts() async { break; } catch (_) {/* 换下一个 asset key */} } + // lucide 图标字体(与原型同款图形库)。 + try { + // package 字体在运行时 family 带 packages// 前缀,FontLoader 须用全名。 + final lucide = FontLoader('packages/lucide_icons_flutter/Lucide') + ..addFont( + rootBundle.load('packages/lucide_icons_flutter/assets/lucide.ttf')); + await lucide.load(); + } catch (_) {/* 包未装时跳过 */} _fontsLoaded = true; }