优化主界面显示

This commit is contained in:
DelLevin-Home
2026-07-10 19:24:14 +08:00
parent f8ea982636
commit 2e6e283218
4 changed files with 43 additions and 42 deletions

View File

@@ -277,7 +277,9 @@ class _BookFormPageState extends State<BookFormPage> {
Row(children: [ Row(children: [
Text('状态', style: TextStyle(fontSize: 12, color: colors.onSurface.withValues(alpha: 0.4))), Text('状态', style: TextStyle(fontSize: 12, color: colors.onSurface.withValues(alpha: 0.4))),
const SizedBox(width: 12), const SizedBox(width: 12),
Container( Expanded(child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
padding: const EdgeInsets.all(2), padding: const EdgeInsets.all(2),
decoration: BoxDecoration(color: colors.surfaceContainerHighest, borderRadius: BorderRadius.circular(6)), decoration: BoxDecoration(color: colors.surfaceContainerHighest, borderRadius: BorderRadius.circular(6)),
child: Row(mainAxisSize: MainAxisSize.min, children: [ child: Row(mainAxisSize: MainAxisSize.min, children: [
@@ -287,6 +289,7 @@ class _BookFormPageState extends State<BookFormPage> {
_buildStatusOption('弃读', 'abandoned'), _buildStatusOption('弃读', 'abandoned'),
]), ]),
), ),
)),
]), ]),
const SizedBox(height: 12), const SizedBox(height: 12),
// 评分 // 评分

View File

@@ -213,6 +213,8 @@ class _NoteFormPageState extends State<NoteFormPage> {
child: Row( child: Row(
children: [ children: [
IconButton( IconButton(
padding: const EdgeInsets.only(left: 12, right: 4),
constraints: const BoxConstraints(),
onPressed: () async { onPressed: () async {
final shouldPop = await _confirmLeave(); final shouldPop = await _confirmLeave();
if (shouldPop && context.mounted) Navigator.pop(context); if (shouldPop && context.mounted) Navigator.pop(context);
@@ -282,11 +284,11 @@ class _NoteFormPageState extends State<NoteFormPage> {
Widget _buildFloatingToolbar() { Widget _buildFloatingToolbar() {
final colors = Theme.of(context).colorScheme; final colors = Theme.of(context).colorScheme;
return Container( return Container(
margin: const EdgeInsets.fromLTRB(12, 8, 12, 10), margin: const EdgeInsets.fromLTRB(12, 4, 12, 6),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8), padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: colors.surfaceContainerHigh, color: colors.surfaceContainerHigh,
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(10),
border: Border.all(color: colors.outlineVariant, width: 0.5), border: Border.all(color: colors.outlineVariant, width: 0.5),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@@ -321,14 +323,6 @@ class _NoteFormPageState extends State<NoteFormPage> {
), ),
), ),
), ),
// 视图模式切换
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<NoteFormPage> {
child: Tooltip( child: Tooltip(
message: tooltip, message: tooltip,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 6), padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 3),
child: Icon(icon, size: 21, color: colors.onSurface.withValues(alpha: 0.7)), child: Icon(icon, size: 18, color: colors.onSurface.withValues(alpha: 0.7)),
), ),
), ),
), ),
@@ -355,9 +349,9 @@ class _NoteFormPageState extends State<NoteFormPage> {
Widget _toolGap() { Widget _toolGap() {
final colors = Theme.of(context).colorScheme; final colors = Theme.of(context).colorScheme;
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 6), padding: const EdgeInsets.symmetric(horizontal: 4),
child: SizedBox( child: SizedBox(
height: 18, height: 14,
child: VerticalDivider(width: 0, thickness: 0.5, color: colors.outline), child: VerticalDivider(width: 0, thickness: 0.5, color: colors.outline),
), ),
); );
@@ -474,6 +468,7 @@ class _NoteFormPageState extends State<NoteFormPage> {
height: 1.6, height: 1.6,
), ),
border: InputBorder.none, border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
contentPadding: const EdgeInsets.all(16), contentPadding: const EdgeInsets.all(16),
), ),
@@ -641,6 +636,7 @@ class _NoteFormPageState extends State<NoteFormPage> {
hintText: '添加标题', hintText: '添加标题',
hintStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.w700, color: colors.onSurface.withValues(alpha: 0.2)), hintStyle: TextStyle(fontSize: 15, fontWeight: FontWeight.w700, color: colors.onSurface.withValues(alpha: 0.2)),
border: InputBorder.none, border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
contentPadding: const EdgeInsets.symmetric(vertical: 8), contentPadding: const EdgeInsets.symmetric(vertical: 8),
isDense: true, isDense: true,

View File

@@ -75,6 +75,8 @@ class _ProfilePageState extends State<ProfilePage> with RouteAware {
return Column( return Column(
children: [ children: [
AppBar( AppBar(
titleSpacing: 8,
leadingWidth: 44,
leading: Builder( leading: Builder(
builder: (context) => IconButton( builder: (context) => IconButton(
icon: Icon(Icons.menu, color: colors.onSurface), icon: Icon(Icons.menu, color: colors.onSurface),

View File

@@ -106,32 +106,32 @@ void showAddSheet(BuildContext context, AppProvider provider) {
final bc = Theme.of(ctx).colorScheme; final bc = Theme.of(ctx).colorScheme;
return SafeArea( return SafeArea(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 10),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Container(
width: 40, width: 32,
height: 4, height: 3,
decoration: BoxDecoration( decoration: BoxDecoration(
color: bc.onSurface.withValues(alpha: 0.15), color: bc.onSurface.withValues(alpha: 0.15),
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 12),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 24), padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row( child: Row(
children: [ children: [
Text('新增记录', Text('新增记录',
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: bc.onSurface)), color: bc.onSurface)),
], ],
), ),
), ),
const SizedBox(height: 16), const SizedBox(height: 8),
...options, ...options,
], ],
), ),
@@ -151,38 +151,38 @@ Widget _buildOption({
return InkWell( return InkWell(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 44, width: 36,
height: 44, height: 36,
decoration: BoxDecoration( decoration: BoxDecoration(
color: colors.surfaceContainerHighest, 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( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(title, Text(title,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: colors.onSurface)), color: colors.onSurface)),
const SizedBox(height: 2), const SizedBox(height: 1),
Text(subtitle, Text(subtitle,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 12,
color: colors.onSurface.withValues(alpha: 0.4))), color: colors.onSurface.withValues(alpha: 0.4))),
], ],
), ),
), ),
Icon(Icons.chevron_right, Icon(Icons.chevron_right,
color: colors.onSurface.withValues(alpha: 0.25), size: 20), color: colors.onSurface.withValues(alpha: 0.25), size: 18),
], ],
), ),
), ),