优化笔记列表界面

This commit is contained in:
DelLevin-Home
2026-08-10 20:57:49 +08:00
parent 5698c232d1
commit ceb51afd03
2 changed files with 19 additions and 4 deletions

View File

@@ -218,6 +218,11 @@ class _NoteTabPageState extends State<NoteTabPage> {
Widget _buildTimelineItem(Note note) { Widget _buildTimelineItem(Note note) {
final colors = Theme.of(context).colorScheme; final colors = Theme.of(context).colorScheme;
final isDark = Theme.of(context).brightness == Brightness.dark;
final cardColor = Color.alphaBlend(
colors.onSurface.withValues(alpha: isDark ? 0.04 : 0.022),
colors.surface,
);
return GestureDetector( return GestureDetector(
onTap: () => _onNoteTap(note), onTap: () => _onNoteTap(note),
onLongPress: () => _showNoteActions(note), onLongPress: () => _showNoteActions(note),
@@ -228,7 +233,7 @@ class _NoteTabPageState extends State<NoteTabPage> {
Expanded(child: Container(width: 1, color: colors.outline)), Expanded(child: Container(width: 1, color: colors.outline)),
])), ])),
Expanded(child: Container(margin: const EdgeInsets.only(bottom: 16), padding: const EdgeInsets.all(14), Expanded(child: Container(margin: const EdgeInsets.only(bottom: 16), padding: const EdgeInsets.all(14),
decoration: BoxDecoration(color: colors.surfaceContainerHigh, borderRadius: BorderRadius.circular(12)), decoration: BoxDecoration(color: cardColor, borderRadius: BorderRadius.circular(8)),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
Row(children: [ Row(children: [
Expanded(child: Text(_formatFullDate(note.updatedAt), style: TextStyle(fontSize: 11, color: colors.onSurface.withValues(alpha: 0.4)))), Expanded(child: Text(_formatFullDate(note.updatedAt), style: TextStyle(fontSize: 11, color: colors.onSurface.withValues(alpha: 0.4)))),
@@ -276,6 +281,11 @@ class _NoteTabPageState extends State<NoteTabPage> {
Widget _buildWaterfallCard(Note note) { Widget _buildWaterfallCard(Note note) {
final colors = Theme.of(context).colorScheme; final colors = Theme.of(context).colorScheme;
final isDark = Theme.of(context).brightness == Brightness.dark;
final cardColor = Color.alphaBlend(
colors.onSurface.withValues(alpha: isDark ? 0.04 : 0.022),
colors.surface,
);
final contentText = _getPreviewText(note); final contentText = _getPreviewText(note);
final images = note.images; final images = note.images;
final hasImage = images.isNotEmpty; final hasImage = images.isNotEmpty;
@@ -284,7 +294,7 @@ class _NoteTabPageState extends State<NoteTabPage> {
onTap: () => _onNoteTap(note), onTap: () => _onNoteTap(note),
onLongPress: () => _showNoteActions(note), onLongPress: () => _showNoteActions(note),
child: Container(margin: const EdgeInsets.only(bottom: 8), child: Container(margin: const EdgeInsets.only(bottom: 8),
decoration: BoxDecoration(color: colors.surface, borderRadius: BorderRadius.circular(10), decoration: BoxDecoration(color: cardColor, borderRadius: BorderRadius.circular(8),
boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.04), blurRadius: 6, offset: const Offset(0, 2))]), boxShadow: [BoxShadow(color: Colors.black.withValues(alpha: 0.04), blurRadius: 6, offset: const Offset(0, 2))]),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [

View File

@@ -30,6 +30,11 @@ class _NoteListItemContent extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme; final colors = Theme.of(context).colorScheme;
final isDark = Theme.of(context).brightness == Brightness.dark;
final cardColor = Color.alphaBlend(
colors.onSurface.withValues(alpha: isDark ? 0.04 : 0.022),
colors.surface,
);
final previewText = _getPreviewText(note); final previewText = _getPreviewText(note);
return GestureDetector( return GestureDetector(
@@ -43,8 +48,8 @@ class _NoteListItemContent extends StatelessWidget {
margin: const EdgeInsets.only(bottom: 6), margin: const EdgeInsets.only(bottom: 6),
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: colors.surfaceContainerHigh, color: cardColor,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(8),
border: selected ? Border.all(color: colors.primary, width: 1.5) : null, border: selected ? Border.all(color: colors.primary, width: 1.5) : null,
), ),
child: Column( child: Column(