- 管理页:单元集 / 计划 / 算法三个维度,卡片带元数据 - 账户页:资料、学习数据、竖直分组的四个功能入口 - 新增设置、文档与帮助(底部可上滑助手)、反馈、关于四个页面 - 抽出 StatBlock 与 GroupedListSection 共用组件 - 关闭 Android 预测式返回,转场改为 M3 水平滑入
80 lines
2.4 KiB
Dart
80 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// 反馈问题:一个最简的提交表单。
|
|
class FeedbackPage extends StatefulWidget {
|
|
const FeedbackPage({super.key});
|
|
|
|
@override
|
|
State<FeedbackPage> createState() => _FeedbackPageState();
|
|
}
|
|
|
|
class _FeedbackPageState extends State<FeedbackPage> {
|
|
final TextEditingController _text = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_text.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
void _submit() {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(
|
|
content: Text('反馈已记录(示例,尚未接入后端)'),
|
|
behavior: SnackBarBehavior.floating,
|
|
),
|
|
);
|
|
_text.clear();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final ThemeData theme = Theme.of(context);
|
|
final ColorScheme colors = theme.colorScheme;
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(title: const Text('反馈问题')),
|
|
body: ListView(
|
|
padding: const EdgeInsets.fromLTRB(16, 16, 16, 32),
|
|
children: <Widget>[
|
|
Text('描述一下遇到的问题或建议', style: theme.textTheme.titleSmall),
|
|
const SizedBox(height: 12),
|
|
TextField(
|
|
controller: _text,
|
|
minLines: 5,
|
|
maxLines: 10,
|
|
decoration: InputDecoration(
|
|
hintText: '例如:在学习页点击「开始学习」没有反应',
|
|
filled: true,
|
|
fillColor: colors.surfaceContainerLow,
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
borderSide: BorderSide(color: colors.outlineVariant),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
borderSide: BorderSide(color: colors.outlineVariant),
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
'提交时会附带应用版本与设备信息,方便定位问题。',
|
|
style: theme.textTheme.bodySmall?.copyWith(
|
|
color: colors.onSurfaceVariant,
|
|
),
|
|
),
|
|
const SizedBox(height: 20),
|
|
FilledButton(
|
|
onPressed: _submit,
|
|
style: FilledButton.styleFrom(
|
|
minimumSize: const Size.fromHeight(48),
|
|
),
|
|
child: const Text('提交反馈'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|