fix(client): rebase 到 main 后适配打印线与 token 体系
main 的打印代码引用了分支已删除的 AppTheme(app_theme.dart)。按「冲突以 main 逻辑为准」
保留 main 的打印预览流程,把三处 AppTheme.* 颜色迁移到分支 token 体系:
- stock_in/out_list 单据详情顶栏:brand50/border/primaryDark → context.tokens.*
- order_print_preview_dialog:import 换 context_tokens,primary/textSecondary → tokens.primary/muted
form 屏改用 main 的 showStock{In,Out}OrderPrint 打印预览入口,随之刷新 12 张 form golden 基线。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@@ -1072,26 +1072,29 @@ class _StockInDetailDialogState extends ConsumerState<_StockInDetailDialog> {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
decoration: const BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppTheme.brand50,
|
color: context.tokens.brand50,
|
||||||
border: Border(bottom: BorderSide(color: AppTheme.border)),
|
border: Border(
|
||||||
|
bottom: BorderSide(color: context.tokens.border)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.arrow_back, color: AppTheme.primaryDark),
|
icon: Icon(Icons.arrow_back,
|
||||||
|
color: context.tokens.primaryDark),
|
||||||
tooltip: '返回',
|
tooltip: '返回',
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
const Text('入库单详情',
|
Text('入库单详情',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: AppTheme.primaryDark)),
|
color: context.tokens.primaryDark)),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (_loadedOrder != null)
|
if (_loadedOrder != null)
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.print_outlined, color: AppTheme.primaryDark),
|
icon: Icon(Icons.print_outlined,
|
||||||
|
color: context.tokens.primaryDark),
|
||||||
tooltip: '打印',
|
tooltip: '打印',
|
||||||
onPressed: () => showStockInOrderPrint(context, ref, _loadedOrder!),
|
onPressed: () => showStockInOrderPrint(context, ref, _loadedOrder!),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -983,26 +983,29 @@ class _StockOutDetailDialogState extends ConsumerState<_StockOutDetailDialog> {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||||
decoration: const BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppTheme.brand50,
|
color: context.tokens.brand50,
|
||||||
border: Border(bottom: BorderSide(color: AppTheme.border)),
|
border: Border(
|
||||||
|
bottom: BorderSide(color: context.tokens.border)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.arrow_back, color: AppTheme.primaryDark),
|
icon: Icon(Icons.arrow_back,
|
||||||
|
color: context.tokens.primaryDark),
|
||||||
tooltip: '返回',
|
tooltip: '返回',
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
const Text('出库单详情',
|
Text('出库单详情',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: AppTheme.primaryDark)),
|
color: context.tokens.primaryDark)),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (_loadedOrder != null)
|
if (_loadedOrder != null)
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.print_outlined, color: AppTheme.primaryDark),
|
icon: Icon(Icons.print_outlined,
|
||||||
|
color: context.tokens.primaryDark),
|
||||||
tooltip: '打印',
|
tooltip: '打印',
|
||||||
onPressed: () => showStockOutOrderPrint(context, ref, _loadedOrder!),
|
onPressed: () => showStockOutOrderPrint(context, ref, _loadedOrder!),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||||||
import 'package:printing/printing.dart';
|
import 'package:printing/printing.dart';
|
||||||
import '../core/auth/auth_state.dart';
|
import '../core/auth/auth_state.dart';
|
||||||
import '../core/errors/error_reporter.dart';
|
import '../core/errors/error_reporter.dart';
|
||||||
import '../core/theme/app_theme.dart';
|
import '../core/theme/context_tokens.dart';
|
||||||
import '../core/responsive/responsive.dart';
|
import '../core/responsive/responsive.dart';
|
||||||
import '../core/utils/print_util.dart';
|
import '../core/utils/print_util.dart';
|
||||||
import '../models/shop.dart';
|
import '../models/shop.dart';
|
||||||
@@ -112,9 +112,9 @@ class _OrderPrintPreviewDialogState extends State<OrderPrintPreviewDialog> {
|
|||||||
Container(
|
Container(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
||||||
decoration: const BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppTheme.primary,
|
color: context.tokens.primary,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(12),
|
topLeft: Radius.circular(12),
|
||||||
topRight: Radius.circular(12),
|
topRight: Radius.circular(12),
|
||||||
),
|
),
|
||||||
@@ -163,7 +163,7 @@ class _OrderPrintPreviewDialogState extends State<OrderPrintPreviewDialog> {
|
|||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: _error.isNotEmpty
|
color: _error.isNotEmpty
|
||||||
? Colors.red
|
? Colors.red
|
||||||
: AppTheme.textSecondary),
|
: context.tokens.muted),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 85 KiB |