From 1e0e3d35d07ee6b3e23655b5f92827871d2af30b Mon Sep 17 00:00:00 2001 From: hejl Date: Fri, 9 May 2025 16:32:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E5=99=A8?= =?UTF-8?q?=E7=BB=93=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/app/widgets/file_explorer.dart | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/win_text_editor/lib/app/widgets/file_explorer.dart b/win_text_editor/lib/app/widgets/file_explorer.dart index d148f3d..71cf8a9 100644 --- a/win_text_editor/lib/app/widgets/file_explorer.dart +++ b/win_text_editor/lib/app/widgets/file_explorer.dart @@ -41,30 +41,9 @@ class _FileExplorerState extends State { final fileProvider = Provider.of(context); return Container( - color: Colors.grey[200], + color: Colors.white, child: Column( children: [ - Padding( - padding: const EdgeInsets.all(4.0), - child: Row( - children: [ - Expanded( - child: TextField( - decoration: const InputDecoration( - hintText: 'Search files...', - prefixIcon: Icon(Icons.search), - isDense: true, - ), - onChanged: (value) => fileProvider.searchFiles(value), - ), - ), - IconButton( - icon: const Icon(Icons.folder_open), // 改为文件夹打开图标 - onPressed: () => _promptForDirectory(context), - ), - ], - ), - ), Expanded( child: Scrollbar( controller: _scrollController, // 添加控制器绑定 @@ -199,8 +178,12 @@ class _FileNodeWidget extends StatelessWidget { ) : const Icon(null, size: 2), node.isDirectory - ? Icon(Icons.folder, color: Colors.cyan[500], size: 16) - : Icon(Icons.file_open, color: Colors.amber[700], size: 16), + ? Icon( + node.isExpanded ? Icons.folder_open : Icons.folder, + color: Colors.cyan[500], + size: 18, + ) + : Icon(node.iconData, color: Colors.amber[700], size: 20), ], ); }