feat(client): 登录/注册页照原型重建,ds 真相源组件族统一全部屏
- 登录/注册(login.html/register.html 1:1):两栏卡片+品牌渐变面板+主题小衣服 pill(onSurface 变体)+记住我(记录并预填最近账号)+原型式 toast 校验; 登录 fidelity 1.4–2.1% 三主题全绿;注册暂不入闸(少 门店编号/兑换券 字段, 已记 CONTRACT,screens.mjs 留存根) - ds 原子补齐:DsToast(.toast 单例)/DsCheck(.check/.agree)/DsButton lg 档/ DsSelect 替换全部旧 DropdownButton/DsField label 在上/DsInput 后缀与密码形态 - 全屏统一:对话框按钮全 DsButton、盒式输入主题钉死(visualDensity.standard、 h38、InputDecorationTheme 渗漏修复)、图标全 lucide、JetBrains Mono 三端同源、 BrandMark 真相源 logo、只读模式写操作全量守卫(WriteGuard+DsToast) - 出入库列表:版式对齐原型(卡片对齐+搜索框居中)、KPI 近30天滚动、结清后 失效财务应收应付表;商品编辑抽屉介绍库改搜索下拉、图片双击全屏预览 - 删除旧 UI 死代码:DataTableCard/FormDialog/PageScaffold/SearchChip/ SelectProductDialog/tabStateProvider - golden/fidelity:stock-in/out 补注册(9%)、login 入册(8%)、goldens 全量重打; 修复 pubspec flutter_web_plugins 非法声明(CI pub get 阻断) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
import '../core/utils/dialog_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../core/theme/context_tokens.dart';
|
||||
import 'ds/ds_atoms.dart';
|
||||
|
||||
/// Compact button → dialog with checkboxes for multi-select filtering
|
||||
class MultiSelectDropdown extends StatelessWidget {
|
||||
@@ -24,7 +26,8 @@ class MultiSelectDropdown extends StatelessWidget {
|
||||
onPressed: options.isEmpty ? null : () => _show(context),
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: active ? context.tokens.primary : context.tokens.muted,
|
||||
side: BorderSide(color: active ? context.tokens.primary : context.tokens.border),
|
||||
side: BorderSide(
|
||||
color: active ? context.tokens.primary : context.tokens.border),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
minimumSize: Size.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
@@ -32,7 +35,7 @@ class MultiSelectDropdown extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.filter_list, size: 13),
|
||||
const Icon(LucideIcons.listFilter, size: 13),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
active ? '$label (${selected.length})' : label,
|
||||
@@ -42,7 +45,7 @@ class MultiSelectDropdown extends StatelessWidget {
|
||||
const SizedBox(width: 4),
|
||||
GestureDetector(
|
||||
onTap: () => onChanged({}),
|
||||
child: const Icon(Icons.close, size: 12),
|
||||
child: const Icon(LucideIcons.x, size: 12),
|
||||
),
|
||||
],
|
||||
],
|
||||
@@ -53,7 +56,7 @@ class MultiSelectDropdown extends StatelessWidget {
|
||||
void _show(BuildContext context) {
|
||||
showAppDialog(
|
||||
context: context,
|
||||
barrierColor: Colors.black12,
|
||||
barrierColor: Colors.black12, // ds-ignore: 弹层遮罩固定色(.mask)
|
||||
builder: (_) => _MultiSelectDialog(
|
||||
label: label,
|
||||
options: options,
|
||||
@@ -121,7 +124,7 @@ class _MultiSelectDialogState extends State<_MultiSelectDialog> {
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(
|
||||
hintText: '搜索…',
|
||||
prefixIcon: Icon(Icons.search, size: 16),
|
||||
prefixIcon: Icon(LucideIcons.search, size: 16),
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(vertical: 8),
|
||||
),
|
||||
@@ -137,17 +140,28 @@ class _MultiSelectDialogState extends State<_MultiSelectDialog> {
|
||||
child: Wrap(
|
||||
spacing: 6,
|
||||
runSpacing: 4,
|
||||
children: _selected.map((s) => Chip(
|
||||
label: Text(s, style: const TextStyle(fontSize: 12)),
|
||||
deleteIcon: const Icon(Icons.close, size: 14),
|
||||
onDeleted: () => setState(() => _selected.remove(s)),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
backgroundColor: context.tokens.primary.withOpacity(0.08),
|
||||
side: BorderSide(color: context.tokens.primary.withOpacity(0.3), width: 0.5),
|
||||
labelPadding: const EdgeInsets.symmetric(horizontal: 2),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 0),
|
||||
)).toList(),
|
||||
children: _selected
|
||||
.map((s) => Chip(
|
||||
label:
|
||||
Text(s, style: const TextStyle(fontSize: 12)),
|
||||
deleteIcon: const Icon(LucideIcons.x, size: 14),
|
||||
onDeleted: () =>
|
||||
setState(() => _selected.remove(s)),
|
||||
materialTapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
backgroundColor:
|
||||
context.tokens.primary.withOpacity(0.08),
|
||||
side: BorderSide(
|
||||
color:
|
||||
context.tokens.primary.withOpacity(0.3),
|
||||
width: 0.5),
|
||||
labelPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 2),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4, vertical: 0),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -199,17 +213,11 @@ class _MultiSelectDialogState extends State<_MultiSelectDialog> {
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('取消'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
widget.onApply(_selected);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('应用'),
|
||||
),
|
||||
DsButton('取消', onPressed: () => Navigator.of(context).pop()),
|
||||
DsButton('应用', variant: DsBtnVariant.primary, onPressed: () {
|
||||
widget.onApply(_selected);
|
||||
Navigator.of(context).pop();
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -254,7 +262,7 @@ class _FilterableColumnHeaderState extends State<FilterableColumnHeader> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 3),
|
||||
child: Icon(
|
||||
active ? Icons.filter_alt : Icons.filter_alt_outlined,
|
||||
active ? LucideIcons.funnel : LucideIcons.funnel,
|
||||
size: 16,
|
||||
color: active ? context.tokens.primary : context.tokens.muted,
|
||||
),
|
||||
@@ -264,8 +272,8 @@ class _FilterableColumnHeaderState extends State<FilterableColumnHeader> {
|
||||
InkWell(
|
||||
onTap: () => widget.onChanged({}),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Icon(Icons.cancel, size: 14,
|
||||
color: context.tokens.primary),
|
||||
child: Icon(LucideIcons.circleX,
|
||||
size: 14, color: context.tokens.primary),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -276,7 +284,7 @@ class _FilterableColumnHeaderState extends State<FilterableColumnHeader> {
|
||||
void _show(BuildContext context) {
|
||||
showAppDialog(
|
||||
context: context,
|
||||
barrierColor: Colors.black12,
|
||||
barrierColor: Colors.black12, // ds-ignore: 弹层遮罩固定色(.mask)
|
||||
builder: (_) => _MultiSelectDialog(
|
||||
label: widget.text,
|
||||
options: widget.options,
|
||||
@@ -320,7 +328,7 @@ class ColumnToggleButton extends StatelessWidget {
|
||||
if (compact) {
|
||||
return IconButton(
|
||||
tooltip: '显示字段',
|
||||
icon: const Icon(Icons.view_column_outlined, size: 20),
|
||||
icon: const Icon(LucideIcons.columns3, size: 20),
|
||||
onPressed: () => _show(context),
|
||||
);
|
||||
}
|
||||
@@ -336,7 +344,7 @@ class ColumnToggleButton extends StatelessWidget {
|
||||
child: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.view_column_outlined, size: 13),
|
||||
Icon(LucideIcons.columns3, size: 13),
|
||||
SizedBox(width: 4),
|
||||
Text('显示字段', style: TextStyle(fontSize: 12)),
|
||||
],
|
||||
@@ -347,7 +355,7 @@ class ColumnToggleButton extends StatelessWidget {
|
||||
void _show(BuildContext context) {
|
||||
showAppDialog(
|
||||
context: context,
|
||||
barrierColor: Colors.black12,
|
||||
barrierColor: Colors.black12, // ds-ignore: 弹层遮罩固定色(.mask)
|
||||
builder: (_) => _ColumnToggleDialog(
|
||||
columns: columns,
|
||||
initial: hidden,
|
||||
@@ -392,8 +400,8 @@ class _ColumnToggleDialogState extends State<_ColumnToggleDialog> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: widget.columns
|
||||
.map((col) => CheckboxListTile(
|
||||
title: Text(col.label,
|
||||
style: const TextStyle(fontSize: 13)),
|
||||
title:
|
||||
Text(col.label, style: const TextStyle(fontSize: 13)),
|
||||
value: !_hidden.contains(col.key),
|
||||
dense: true,
|
||||
onChanged: col.required
|
||||
@@ -410,17 +418,11 @@ class _ColumnToggleDialogState extends State<_ColumnToggleDialog> {
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('取消'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
widget.onApply(_hidden);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('应用'),
|
||||
),
|
||||
DsButton('取消', onPressed: () => Navigator.of(context).pop()),
|
||||
DsButton('应用', variant: DsBtnVariant.primary, onPressed: () {
|
||||
widget.onApply(_hidden);
|
||||
Navigator.of(context).pop();
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user