UI更新
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../core/module/app_module.dart';
|
||||
import '../../core/network/api_exception.dart';
|
||||
import '../../core/network/auth_redirect.dart';
|
||||
import '../../models/account.dart';
|
||||
@@ -12,7 +13,6 @@ import '../../utils/amount_input_formatter.dart';
|
||||
import '../../utils/amount_util.dart';
|
||||
import '../../utils/toast.dart';
|
||||
import '../../widgets/state_views.dart';
|
||||
import '../note/note_list_page.dart';
|
||||
|
||||
/// 「我的」页面
|
||||
///
|
||||
@@ -52,7 +52,7 @@ class MinePage extends ConsumerWidget {
|
||||
const SizedBox(height: 14),
|
||||
_budgetCard(context, ref, budgetAsync),
|
||||
const SizedBox(height: 14),
|
||||
_notesEntry(context),
|
||||
_moduleSection(context),
|
||||
const SizedBox(height: 24),
|
||||
_logoutButton(context),
|
||||
const SizedBox(height: 90),
|
||||
@@ -369,43 +369,73 @@ class MinePage extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------- 笔记入口 ----------------
|
||||
Widget _notesEntry(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const NoteListPage()),
|
||||
),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.fromLTRB(18, 16, 14, 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
// ---------------- 功能模块 ----------------
|
||||
//
|
||||
// 和首页仪表盘的卡片共用同一份注册表(core/module/app_module.dart),
|
||||
// 所以新增模块时这个页面不用改。
|
||||
Widget _moduleSection(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
clipBehavior: Clip.antiAlias, // 让水波纹被圆角裁掉
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(18, 16, 8, 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'功能模块',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF5D4037),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
for (final module in appModules) _moduleRow(context, module),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _moduleRow(BuildContext context, AppModule module) {
|
||||
return InkWell(
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: module.open),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
const Text('📝', style: TextStyle(fontSize: 24)),
|
||||
const SizedBox(width: 14),
|
||||
const Expanded(
|
||||
Text(module.icon, style: const TextStyle(fontSize: 20)),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'我的笔记',
|
||||
style: TextStyle(
|
||||
module.name,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF5D4037),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 3),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
'管理 Markdown 文档,随时查看和记录',
|
||||
style: TextStyle(fontSize: 12.5, color: Color(0xFF8D6E63)),
|
||||
module.blurb,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(fontSize: 12, color: Color(0xFF8D6E63)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(Icons.chevron_right, color: Color(0xFFBCAAA4)),
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(right: 3),
|
||||
child: Icon(Icons.chevron_right, color: Color(0xFFBCAAA4)),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user