This commit is contained in:
2026-09-23 15:33:59 +08:00
parent e4cdfbc42f
commit a83cda63f5
24 changed files with 874 additions and 81 deletions
+165
View File
@@ -0,0 +1,165 @@
import 'package:flutter/material.dart';
/// 助手页(占位)。
///
/// 现在是骨架里预留的位置 —— 先让布局一次到位,阶段 B 接 AI 时只填内容、
/// 不再动导航结构。同时它也是首页那个输入框的落地页。
class AssistantPage extends StatelessWidget {
const AssistantPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: double.infinity,
height: double.infinity,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xFFFFE5CC), Color(0xFFFFD4A8), Color(0xFFFFC08A)],
),
),
child: SafeArea(
child: Column(
children: [
_header(context),
Expanded(
child: ListView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.fromLTRB(24, 40, 24, 0),
children: [
const Center(child: Text('✨', style: TextStyle(fontSize: 46))),
const SizedBox(height: 16),
const Center(
child: Text(
'AI 助手正在建设中',
style: TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: Color(0xFF5D4037),
),
),
),
const SizedBox(height: 8),
const Center(
child: Text(
'位置已经预留好,接入后不用再改布局',
style: TextStyle(fontSize: 12.5, color: Color(0xFF8D6E63)),
),
),
const SizedBox(height: 28),
_planCard(),
const SizedBox(height: 90),
],
),
),
],
),
),
),
);
}
/// 用 Tab 打开时没有上一页,就不显示返回箭头
Widget _header(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(10, 6, 16, 6),
child: Row(
children: [
if (Navigator.of(context).canPop())
InkWell(
onTap: () => Navigator.of(context).pop(),
borderRadius: BorderRadius.circular(20),
child: const Padding(
padding: EdgeInsets.all(6),
child: Icon(Icons.arrow_back, size: 22, color: Color(0xFF5D4037)),
),
),
const Padding(
padding: EdgeInsets.only(left: 6),
child: Text(
'助手',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Color(0xFF5D4037),
),
),
),
],
),
);
}
Widget _planCard() {
const items = [
('一句话记账', '「昨天买咖啡 32」→ 自动填好分类和金额'),
('笔记问答', '从你的知识库里找答案,而不是重读一遍'),
('服务器状态', '查状态、看日志 —— 只走预定义动作,不给任意 shell'),
('跨模块查询', '「上周服务器相关的花费」这类要跨模块的问题'),
];
return Container(
padding: const EdgeInsets.fromLTRB(18, 16, 18, 8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'规划中的能力',
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: Color(0xFF5D4037),
),
),
const SizedBox(height: 12),
for (final (title, desc) in items) ...[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.only(top: 5),
child: Icon(Icons.circle, size: 5, color: Color(0xFFC8956E)),
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 13.5,
fontWeight: FontWeight.w600,
color: Color(0xFF5D4037),
),
),
const SizedBox(height: 2),
Text(
desc,
style: const TextStyle(fontSize: 12, color: Color(0xFF8D6E63)),
),
],
),
),
],
),
const SizedBox(height: 14),
],
const Divider(height: 1, color: Color(0xFFF0E6D8)),
const SizedBox(height: 10),
const Text(
'隐私:涉及你笔记里的服务器信息时,会在请求发出前先脱敏。',
style: TextStyle(fontSize: 11.5, color: Color(0xFFBCAAA4), height: 1.5),
),
const SizedBox(height: 8),
],
),
);
}
}