refactor: 穿搭页移除个人信息检查卡,职责收敛为任务参数

个人信息(照片/身形)归「我的形象」管理,穿搭页只保留
日期范围/地点/生成 + 已有方案列表

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 16:31:30 +08:00
co-authored by Claude Opus 4.7
parent 3e457b700a
commit cdfd8cff59
+2 -128
View File
@@ -6,12 +6,9 @@ import 'package:go_router/go_router.dart';
import '../../shared/widgets/empty_view.dart';
import '../../shared/widgets/error_view.dart';
import '../../shared/widgets/loading_view.dart';
import '../profile/body_provider.dart';
import '../profile/photo_upload_provider.dart';
import 'outfit_provider.dart';
/// 穿搭:造型方案制作向导
/// 输入 = 个人信息(照片/身形)+ 任务参数(日期范围/地点)→ AI 生成造型方案
/// 穿搭:任务参数(日期范围/地点)→ 生成造型方案;个人信息在「我的形象」管理
class OutfitPage extends ConsumerStatefulWidget {
const OutfitPage({super.key});
@@ -79,15 +76,8 @@ class _OutfitPageState extends ConsumerState<OutfitPage> {
Widget build(BuildContext context) {
final plans = ref.watch(outfitPlanProvider);
final gen = ref.watch(generateProvider);
final photos = ref.watch(photoProvider);
final body = ref.watch(bodyProvider);
final scheme = Theme.of(context).colorScheme;
final uploadedTypes = photos.value?.map((p) => p.type).toSet() ?? <int>{};
final bodyReady = body.value != null && body.value!.height > 0;
final photoCount = PhotoType.all.where(uploadedTypes.contains).length;
final doneCount = photoCount + (bodyReady ? 1 : 0);
return Scaffold(
appBar: AppBar(title: const Text('造型穿搭')),
body: RefreshIndicator(
@@ -101,77 +91,7 @@ class _OutfitPageState extends ConsumerState<OutfitPage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.face_retouching_natural,
color: scheme.primary),
const SizedBox(width: 8),
Expanded(
child: Text('个人信息(AI 生成依据)',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: scheme.primary)),
),
Chip(
label: Text('$doneCount/5'),
visualDensity: VisualDensity.compact,
),
],
),
const SizedBox(height: 8),
for (final type in PhotoType.all)
_StatusRow(
ok: uploadedTypes.contains(type),
text: '${PhotoType.labels[type]}照片',
trailingText:
uploadedTypes.contains(type) ? '已上传' : '未上传',
actionText:
uploadedTypes.contains(type) ? null : '去完善',
onAction: () => context.push('/photo-guide'),
),
_StatusRow(
ok: bodyReady,
text: '身形参数',
trailingText: bodyReady
? '${body.value!.height}cm · ${body.value!.weight}kg · 肤色${body.value!.skinTone}'
: '未设置',
actionText: bodyReady ? '调整' : '去设置',
onAction: () => context.push('/body-tune'),
),
const SizedBox(height: 8),
if (doneCount == 5)
Row(
children: [
const Icon(Icons.check_circle,
size: 16, color: Colors.green),
const SizedBox(width: 6),
Expanded(
child: Text(
'个人信息齐全,生成的方案将更贴合你的身材与气质',
style: const TextStyle(
fontSize: 12, color: Colors.green),
),
),
],
)
else
Text(
'完善个人信息后,AI 生成的造型方案将更贴合你的身材与气质',
style: const TextStyle(fontSize: 12, color: Colors.grey),
),
],
),
),
),
const SizedBox(height: 12),
Card(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('任务参数',
Text('生成穿搭方案',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
@@ -263,52 +183,6 @@ class _OutfitPageState extends ConsumerState<OutfitPage> {
}
}
class _StatusRow extends StatelessWidget {
final bool ok;
final String text;
final String trailingText;
final String? actionText;
final VoidCallback? onAction;
const _StatusRow({
required this.ok,
required this.text,
required this.trailingText,
this.actionText,
this.onAction,
});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Icon(
ok ? Icons.check_circle : Icons.radio_button_unchecked,
size: 16,
color: ok ? Colors.green : Colors.grey,
),
const SizedBox(width: 8),
Expanded(
child: Text(text, style: const TextStyle(fontSize: 13)),
),
Text(trailingText,
style: const TextStyle(fontSize: 12, color: Colors.grey)),
if (actionText != null)
TextButton(
onPressed: onAction,
style: TextButton.styleFrom(
visualDensity: VisualDensity.compact,
padding: const EdgeInsets.symmetric(horizontal: 8)),
child: Text(actionText!),
),
],
),
);
}
}
class _PlanCard extends ConsumerWidget {
final OutfitPlanInfo plan;