From 2e6e28321822b784f41678c9e66adb5467f86183 Mon Sep 17 00:00:00 2001 From: DelLevin-Home Date: Fri, 10 Jul 2026 19:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=BB=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/book/book_form_page.dart | 23 ++++++++++--------- lib/pages/note/note_form_page.dart | 26 ++++++++++------------ lib/pages/profile/profile_page.dart | 2 ++ lib/widgets/add_sheet.dart | 34 ++++++++++++++--------------- 4 files changed, 43 insertions(+), 42 deletions(-) diff --git a/lib/pages/book/book_form_page.dart b/lib/pages/book/book_form_page.dart index 859c6c8..9d1354e 100644 --- a/lib/pages/book/book_form_page.dart +++ b/lib/pages/book/book_form_page.dart @@ -277,16 +277,19 @@ class _BookFormPageState extends State { Row(children: [ Text('状态', style: TextStyle(fontSize: 12, color: colors.onSurface.withValues(alpha: 0.4))), const SizedBox(width: 12), - Container( - padding: const EdgeInsets.all(2), - decoration: BoxDecoration(color: colors.surfaceContainerHighest, borderRadius: BorderRadius.circular(6)), - child: Row(mainAxisSize: MainAxisSize.min, children: [ - _buildStatusOption('想读', 'want_to_read'), - _buildStatusOption('在读', 'reading'), - _buildStatusOption('已读', 'read'), - _buildStatusOption('弃读', 'abandoned'), - ]), - ), + Expanded(child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + padding: const EdgeInsets.all(2), + decoration: BoxDecoration(color: colors.surfaceContainerHighest, borderRadius: BorderRadius.circular(6)), + child: Row(mainAxisSize: MainAxisSize.min, children: [ + _buildStatusOption('想读', 'want_to_read'), + _buildStatusOption('在读', 'reading'), + _buildStatusOption('已读', 'read'), + _buildStatusOption('弃读', 'abandoned'), + ]), + ), + )), ]), const SizedBox(height: 12), // 评分 diff --git a/lib/pages/note/note_form_page.dart b/lib/pages/note/note_form_page.dart index 1103e7b..90046cb 100644 --- a/lib/pages/note/note_form_page.dart +++ b/lib/pages/note/note_form_page.dart @@ -213,6 +213,8 @@ class _NoteFormPageState extends State { child: Row( children: [ IconButton( + padding: const EdgeInsets.only(left: 12, right: 4), + constraints: const BoxConstraints(), onPressed: () async { final shouldPop = await _confirmLeave(); if (shouldPop && context.mounted) Navigator.pop(context); @@ -282,11 +284,11 @@ class _NoteFormPageState extends State { Widget _buildFloatingToolbar() { final colors = Theme.of(context).colorScheme; return Container( - margin: const EdgeInsets.fromLTRB(12, 8, 12, 10), - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), + margin: const EdgeInsets.fromLTRB(12, 4, 12, 6), + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4), decoration: BoxDecoration( color: colors.surfaceContainerHigh, - borderRadius: BorderRadius.circular(12), + borderRadius: BorderRadius.circular(10), border: Border.all(color: colors.outlineVariant, width: 0.5), boxShadow: [ BoxShadow( @@ -321,14 +323,6 @@ class _NoteFormPageState extends State { ), ), ), - // 视图模式切换 - const SizedBox(width: 8), - Container( - width: 1, height: 20, color: colors.outline, - ), - const SizedBox(width: 8), - _modeSwitch(Icons.edit, 'edit'), - _modeSwitch(Icons.visibility, 'preview'), ], ), ); @@ -344,8 +338,8 @@ class _NoteFormPageState extends State { child: Tooltip( message: tooltip, child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 6), - child: Icon(icon, size: 21, color: colors.onSurface.withValues(alpha: 0.7)), + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 3), + child: Icon(icon, size: 18, color: colors.onSurface.withValues(alpha: 0.7)), ), ), ), @@ -355,9 +349,9 @@ class _NoteFormPageState extends State { Widget _toolGap() { final colors = Theme.of(context).colorScheme; return Padding( - padding: const EdgeInsets.symmetric(horizontal: 6), + padding: const EdgeInsets.symmetric(horizontal: 4), child: SizedBox( - height: 18, + height: 14, child: VerticalDivider(width: 0, thickness: 0.5, color: colors.outline), ), ); @@ -474,6 +468,7 @@ class _NoteFormPageState extends State { height: 1.6, ), border: InputBorder.none, + enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, contentPadding: const EdgeInsets.all(16), ), @@ -641,6 +636,7 @@ class _NoteFormPageState extends State { hintText: '添加标题', hintStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.w700, color: colors.onSurface.withValues(alpha: 0.2)), border: InputBorder.none, + enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, contentPadding: const EdgeInsets.symmetric(vertical: 8), isDense: true, diff --git a/lib/pages/profile/profile_page.dart b/lib/pages/profile/profile_page.dart index 3f021e1..a6eb359 100644 --- a/lib/pages/profile/profile_page.dart +++ b/lib/pages/profile/profile_page.dart @@ -75,6 +75,8 @@ class _ProfilePageState extends State with RouteAware { return Column( children: [ AppBar( + titleSpacing: 8, + leadingWidth: 44, leading: Builder( builder: (context) => IconButton( icon: Icon(Icons.menu, color: colors.onSurface), diff --git a/lib/widgets/add_sheet.dart b/lib/widgets/add_sheet.dart index 3101eae..fc63ac5 100644 --- a/lib/widgets/add_sheet.dart +++ b/lib/widgets/add_sheet.dart @@ -106,32 +106,32 @@ void showAddSheet(BuildContext context, AppProvider provider) { final bc = Theme.of(ctx).colorScheme; return SafeArea( child: Padding( - padding: const EdgeInsets.symmetric(vertical: 16), + padding: const EdgeInsets.symmetric(vertical: 10), child: Column( mainAxisSize: MainAxisSize.min, children: [ Container( - width: 40, - height: 4, + width: 32, + height: 3, decoration: BoxDecoration( color: bc.onSurface.withValues(alpha: 0.15), borderRadius: BorderRadius.circular(2), ), ), - const SizedBox(height: 20), + const SizedBox(height: 12), Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), + padding: const EdgeInsets.symmetric(horizontal: 20), child: Row( children: [ Text('新增记录', style: TextStyle( - fontSize: 18, + fontSize: 16, fontWeight: FontWeight.w600, color: bc.onSurface)), ], ), ), - const SizedBox(height: 16), + const SizedBox(height: 8), ...options, ], ), @@ -151,38 +151,38 @@ Widget _buildOption({ return InkWell( onTap: onTap, child: Container( - padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14), + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8), child: Row( children: [ Container( - width: 44, - height: 44, + width: 36, + height: 36, decoration: BoxDecoration( color: colors.surfaceContainerHighest, - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(8), ), - child: Icon(icon, size: 22, color: colors.onSurface.withValues(alpha: 0.6)), + child: Icon(icon, size: 18, color: colors.onSurface.withValues(alpha: 0.6)), ), - const SizedBox(width: 16), + const SizedBox(width: 12), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(title, style: TextStyle( - fontSize: 16, + fontSize: 14, fontWeight: FontWeight.w500, color: colors.onSurface)), - const SizedBox(height: 2), + const SizedBox(height: 1), Text(subtitle, style: TextStyle( - fontSize: 13, + fontSize: 12, color: colors.onSurface.withValues(alpha: 0.4))), ], ), ), Icon(Icons.chevron_right, - color: colors.onSurface.withValues(alpha: 0.25), size: 20), + color: colors.onSurface.withValues(alpha: 0.25), size: 18), ], ), ),