AI 接入 V1.0
UI更新
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../models/note.dart';
|
||||
import '../../widgets/cute_icon.dart';
|
||||
|
||||
/// 目录选择面板
|
||||
///
|
||||
@@ -114,7 +115,7 @@ class _FolderPickerSheetState extends State<FolderPickerSheet> {
|
||||
children: [
|
||||
if (widget.showAll)
|
||||
_row(
|
||||
icon: '📚',
|
||||
icon: 'education',
|
||||
name: '全部',
|
||||
count: widget.tree.totalCount,
|
||||
depth: 0,
|
||||
@@ -122,7 +123,7 @@ class _FolderPickerSheetState extends State<FolderPickerSheet> {
|
||||
onTap: () => Navigator.pop(context, NoteLocation.all),
|
||||
),
|
||||
_row(
|
||||
icon: '📥',
|
||||
icon: 'income',
|
||||
name: '未分类',
|
||||
count: widget.tree.uncategorizedCount,
|
||||
depth: 0,
|
||||
@@ -153,7 +154,7 @@ class _FolderPickerSheetState extends State<FolderPickerSheet> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_row(
|
||||
icon: (open && hasChildren) ? '📂' : '📁',
|
||||
icon: (open && hasChildren) ? 'folder-open' : 'folder',
|
||||
name: node.name,
|
||||
count: node.noteCount,
|
||||
depth: depth,
|
||||
@@ -221,7 +222,7 @@ class _FolderPickerSheetState extends State<FolderPickerSheet> {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(icon, style: const TextStyle(fontSize: 15)),
|
||||
CuteIcon(icon, size: 17),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
|
||||
@@ -231,7 +231,7 @@ class NoteDetailPage extends ConsumerWidget {
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: const Text(
|
||||
'🖼 图片加载失败',
|
||||
'图片加载失败',
|
||||
style: TextStyle(fontSize: 13, color: Color(0xFFBCAAA4)),
|
||||
),
|
||||
),
|
||||
@@ -277,7 +277,7 @@ class NoteDetailPage extends ConsumerWidget {
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: resolveAssetUrl(href)));
|
||||
Navigator.pop(sheetContext);
|
||||
showToast(context, '✅ 已复制链接');
|
||||
showToast(context, '已复制链接', icon: 'check');
|
||||
},
|
||||
style: FilledButton.styleFrom(backgroundColor: const Color(0xFFC8956E)),
|
||||
child: const Text('复制'),
|
||||
@@ -358,7 +358,7 @@ class NoteDetailPage extends ConsumerWidget {
|
||||
await ref.read(noteApiProvider).update(note.id, pinned: !note.pinned);
|
||||
ref.invalidate(noteDetailProvider(noteId));
|
||||
await ref.read(noteListProvider.notifier).refresh();
|
||||
if (context.mounted) showToast(context, note.pinned ? '已取消置顶' : '📌 已置顶');
|
||||
if (context.mounted) showToast(context, note.pinned ? '已取消置顶' : '已置顶', icon: 'pin');
|
||||
} on ApiException catch (e) {
|
||||
if (context.mounted) showToast(context, e.message, error: true);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class _NoteEditPageState extends ConsumerState<NoteEditPage> {
|
||||
}
|
||||
if (!mounted) return;
|
||||
_saved = true;
|
||||
showToast(context, '✅ 已保存');
|
||||
showToast(context, '已保存', icon: 'check');
|
||||
Navigator.of(context).pop(true);
|
||||
} on ApiException catch (e) {
|
||||
if (mounted) showToast(context, e.message, error: true);
|
||||
@@ -246,7 +246,7 @@ class _NoteEditPageState extends ConsumerState<NoteEditPage> {
|
||||
final content = _contentController.text;
|
||||
if (content.trim().isEmpty) {
|
||||
return const Center(
|
||||
child: EmptyView(icon: '📄', title: '还没有内容', tip: '切回编辑模式写点什么吧'),
|
||||
child: EmptyView(icon: 'file', title: '还没有内容', tip: '切回编辑模式写点什么吧'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import '../../utils/toast.dart';
|
||||
import '../../widgets/state_views.dart';
|
||||
import 'folder_picker_sheet.dart';
|
||||
import 'note_detail_page.dart';
|
||||
import '../../widgets/cute_icon.dart';
|
||||
|
||||
/// 笔记列表页
|
||||
///
|
||||
@@ -308,7 +309,7 @@ class _NoteListPageState extends ConsumerState<NoteListPage> {
|
||||
children: [
|
||||
SizedBox(height: MediaQuery.of(context).size.height * 0.18),
|
||||
EmptyView(
|
||||
icon: state.hasFilter ? '🔍' : '📝',
|
||||
icon: state.hasFilter ? 'search' : 'note',
|
||||
title: state.hasFilter ? '没有匹配的笔记' : '还没有笔记',
|
||||
tip: state.hasFilter
|
||||
? '换个关键词或标签试试'
|
||||
@@ -383,7 +384,7 @@ class _NoteListPageState extends ConsumerState<NoteListPage> {
|
||||
Row(
|
||||
children: [
|
||||
if (note.pinned) ...[
|
||||
const Text('📌', style: TextStyle(fontSize: 13)),
|
||||
const CuteIcon('pin', size: 14),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
Expanded(
|
||||
@@ -471,7 +472,7 @@ class _NoteListPageState extends ConsumerState<NoteListPage> {
|
||||
await ref.read(noteListProvider.notifier).refresh();
|
||||
ref.invalidate(noteTagsProvider);
|
||||
ref.invalidate(noteFolderTreeProvider); // 目录上的笔记数变了
|
||||
if (mounted) showToast(context, '✅ 已记录');
|
||||
if (mounted) showToast(context, '已记录', icon: 'check');
|
||||
} on ApiException catch (e) {
|
||||
if (mounted) showToast(context, e.message, error: true);
|
||||
} catch (_) {
|
||||
|
||||
Reference in New Issue
Block a user