副屏
This commit is contained in:
1 parent
154122a847
commit
2e929c199b
21 files changed
+5517
-85
No files matched your search
@@ -303,14 +303,15 @@ class _FaceRecognitionPanelState extends State<FaceRecognitionPanel> {
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: gap),
|
||||
_FaceRecognitionStatusCard(
|
||||
status: status,
|
||||
message: _failure?.message ?? _event?.message,
|
||||
compact: widget.compact,
|
||||
),
|
||||
SizedBox(height: gap),
|
||||
_FaceRecognitionPrivacyHint(compact: widget.compact),
|
||||
// 识别进行中不展示“正对摄像头/建议距离”类姿态引导,仅在启动、成功或失败时给出状态卡。
|
||||
if (status != FaceRecognitionSessionStatus.detecting) ...[
|
||||
SizedBox(height: gap),
|
||||
_FaceRecognitionStatusCard(
|
||||
status: status,
|
||||
message: _failure?.message ?? _event?.message,
|
||||
compact: widget.compact,
|
||||
),
|
||||
],
|
||||
if (_failure != null || widget.showCancelAction) ...[
|
||||
SizedBox(height: gap),
|
||||
<Widget>[
|
||||
@@ -364,7 +365,7 @@ class _FaceRecognitionStatusCard extends StatelessWidget {
|
||||
? '识别成功'
|
||||
: status == FaceRecognitionSessionStatus.initializing
|
||||
? '正在启动摄像头'
|
||||
: '请顾客正对摄像头';
|
||||
: '人脸识别中';
|
||||
final icon = failed
|
||||
? Icons.error_outline_rounded
|
||||
: success
|
||||
@@ -386,7 +387,7 @@ class _FaceRecognitionStatusCard extends StatelessWidget {
|
||||
Text(
|
||||
message?.trim().isNotEmpty == true
|
||||
? message!.trim()
|
||||
: '保持面部完整出现在识别框内',
|
||||
: '正在准备识别画面',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(color: XfjDesignTokens.muted, fontSize: 14.sp),
|
||||
@@ -403,42 +404,6 @@ class _FaceRecognitionStatusCard extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 人脸画面使用范围和识别距离提示。
|
||||
class _FaceRecognitionPrivacyHint extends StatelessWidget {
|
||||
/// 创建紧凑或常规密度的隐私提示。
|
||||
const _FaceRecognitionPrivacyHint({required this.compact});
|
||||
|
||||
/// 是否使用收银工作区紧凑间距。
|
||||
final bool compact;
|
||||
|
||||
/// 构建不会与主状态争夺层级的次要说明。
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return <Widget>[
|
||||
Icon(
|
||||
Icons.face_retouching_natural_rounded,
|
||||
color: XfjDesignTokens.primary,
|
||||
size: 22.w,
|
||||
),
|
||||
SizedBox(width: 10.w),
|
||||
Text(
|
||||
'建议距离 50-80cm,保持面部完整可见',
|
||||
style: TextStyle(color: XfjDesignTokens.muted, fontSize: 14.sp),
|
||||
).expanded(),
|
||||
Text(
|
||||
'画面仅用于本次识别',
|
||||
style: TextStyle(color: XfjDesignTokens.muted, fontSize: 13.sp),
|
||||
),
|
||||
]
|
||||
.toRow(crossAxisAlignment: CrossAxisAlignment.center)
|
||||
.padding(horizontal: 14.w, vertical: compact ? 10.h : 12.h)
|
||||
.decorated(
|
||||
color: XfjDesignTokens.control,
|
||||
borderRadius: BorderRadius.circular(XfjDesignTokens.controlRadius),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 人脸面板底部的固定高度操作按钮。
|
||||
class _FacePanelButton extends StatelessWidget {
|
||||
/// 创建主操作或描边操作按钮。
|
||||
|
||||
Reference in new issue
Block a user