From 649d8041851b50abc3cf6a5dbce0ded1cab958f3 Mon Sep 17 00:00:00 2001 From: hejl Date: Wed, 4 Jun 2025 15:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content_search_controller.dart | 6 + .../content_search/widgets/results_view.dart | 138 +++++++++++++++-- .../widgets/search_settings.dart | 11 +- .../widgets/condition_setting.dart | 2 +- .../data_extract/widgets/results_view.dart | 32 +++- .../lib/shared/components/my_grid_column.dart | 14 ++ win_text_editor/pubspec.lock | 145 +++++++++--------- win_text_editor/pubspec.yaml | 1 + 8 files changed, 241 insertions(+), 108 deletions(-) diff --git a/win_text_editor/lib/modules/content_search/controllers/content_search_controller.dart b/win_text_editor/lib/modules/content_search/controllers/content_search_controller.dart index f3122c7..f6f9978 100644 --- a/win_text_editor/lib/modules/content_search/controllers/content_search_controller.dart +++ b/win_text_editor/lib/modules/content_search/controllers/content_search_controller.dart @@ -134,6 +134,12 @@ class ContentSearchController extends BaseContentController { } } + // 在 ContentSearchController 类中添加 + void removeResultByFilePath(String filePath) { + results.removeWhere((result) => result.filePath == filePath); + notifyListeners(); // 如果控制器是 ChangeNotifier + } + Future startSearch() async { _shouldStop = false; _isSearching = true; diff --git a/win_text_editor/lib/modules/content_search/widgets/results_view.dart b/win_text_editor/lib/modules/content_search/widgets/results_view.dart index 5334619..06c88ab 100644 --- a/win_text_editor/lib/modules/content_search/widgets/results_view.dart +++ b/win_text_editor/lib/modules/content_search/widgets/results_view.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; import 'package:syncfusion_flutter_datagrid/datagrid.dart'; import 'package:path/path.dart' as path; +import 'package:win_text_editor/framework/controllers/logger.dart'; import 'package:win_text_editor/modules/content_search/controllers/content_search_controller.dart'; import 'package:file_picker/file_picker.dart'; import 'dart:io'; @@ -9,6 +11,7 @@ import 'dart:io'; import 'package:win_text_editor/modules/content_search/models/search_mode.dart'; import 'package:win_text_editor/modules/content_search/models/search_result.dart'; import 'package:win_text_editor/shared/components/my_grid_column.dart'; +// import 'package:recycle_bin/recycle_bin.dart'; class ResultsView extends StatelessWidget { const ResultsView({super.key}); @@ -30,7 +33,7 @@ class ResultsView extends StatelessWidget { onSecondaryTapDown: (details) { _showContextMenu(context, details.globalPosition, controller); }, - child: _buildResultsGrid(controller), + child: _buildResultsGrid(controller, context), ), ); } @@ -97,20 +100,22 @@ class ResultsView extends StatelessWidget { } } - Widget _buildResultsGrid(ContentSearchController controller) { + Widget _buildResultsGrid(ContentSearchController controller, BuildContext context) { return controller.searchMode == SearchMode.locate - ? _buildLocateGrid(controller) + ? _buildLocateGrid(controller, context) : _buildCountGrid(controller); } - Widget _buildLocateGrid(ContentSearchController controller) { + Widget _buildLocateGrid(ContentSearchController controller, BuildContext context) { return SfDataGrid( rowHeight: 32, headerRowHeight: 32, - source: LocateDataSource(controller), + source: LocateDataSource(controller, context), columns: [ + ShortGridColumn(columnName: 'index', label: '序号'), MyGridColumn(columnName: 'file', label: '文件(行号)', minimumWidth: 300), MyGridColumn(columnName: 'content', label: '内容'), + ShortGridColumn(columnName: 'action', label: '操作'), ], selectionMode: SelectionMode.multiple, navigationMode: GridNavigationMode.cell, @@ -131,6 +136,7 @@ class ResultsView extends StatelessWidget { headerRowHeight: 32, source: CountDataSource(controller), columns: [ + ShortGridColumn(columnName: 'index', label: '序号'), MyGridColumn(columnName: 'keyword', label: '关键词', minimumWidth: 300), MyGridColumn(columnName: 'count', label: '匹配数量'), ], @@ -147,21 +153,28 @@ class ResultsView extends StatelessWidget { class LocateDataSource extends DataGridSource { final ContentSearchController controller; + final BuildContext context; - LocateDataSource(this.controller); + LocateDataSource(this.controller, this.context); @override List get rows => - controller.results.map((result) { + controller.results.asMap().entries.map((result) { + final index = result.key + 1; return DataGridRow( cells: [ + DataGridCell(columnName: 'index', value: index), DataGridCell( columnName: 'file', - value: '${path.basename(result.filePath)}(${result.lineNumber})', + value: '${path.basename(result.value.filePath)}(${result.value.lineNumber})', ), DataGridCell( columnName: 'content', - value: result, // 传递整个结果对象用于高亮显示 + value: result.value, // 传递整个结果对象用于高亮显示 + ), + DataGridCell( + columnName: 'action', + value: result.value.filePath, // Store file path for delete action ), ], ); @@ -170,29 +183,113 @@ class LocateDataSource extends DataGridSource { @override DataGridRowAdapter? buildRow(DataGridRow row) { final cells = row.getCells(); - final result = cells[1].value as SearchResult; + final result = cells[2].value as SearchResult; return DataGridRowAdapter( cells: [ + Container( + alignment: Alignment.center, + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text(cells[0].value.toString()), + ), // 文件名单元格 Container( alignment: Alignment.centerLeft, - padding: const EdgeInsets.all(8.0), - child: Text(cells[0].value.toString(), overflow: TextOverflow.ellipsis, maxLines: 1), + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Text(cells[1].value.toString(), overflow: TextOverflow.ellipsis, maxLines: 1), ), // 内容单元格(带高亮) Container( alignment: Alignment.centerLeft, - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric(horizontal: 8), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: _buildHighlightedText(result.lineContent, result.matches), ), ), + Container( + alignment: Alignment.center, + child: IconButton( + icon: const Icon(Icons.delete_forever, size: 18, color: Colors.red), + onPressed: () => _showDeleteConfirmation(result.filePath), + ), + ), ], ); } + Future _showDeleteConfirmation(String filePath) async { + bool confirmed = false; + + await showDialog( + context: context, + builder: (context) { + // 捕获键盘事件 + return Shortcuts( + shortcuts: const { + // 绑定回车键 + SingleActivator(LogicalKeyboardKey.enter): _ConfirmAction(), + }, + child: Actions( + actions: { + _ConfirmAction: CallbackAction<_ConfirmAction>( + onInvoke: (_) { + confirmed = true; + Navigator.pop(context, true); + return null; + }, + ), + }, + child: Focus( + autofocus: true, // 自动获取焦点 + child: AlertDialog( + title: const Text('确认删除'), + content: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('将所选文件删除吗?'), + const SizedBox(height: 8), + Text(filePath, style: const TextStyle(fontSize: 12, color: Colors.grey)), + ], + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('取消'), + ), + TextButton( + onPressed: () { + confirmed = true; + Navigator.pop(context, true); + }, + child: const Text('确认'), + ), + ], + ), + ), + ), + ); + }, + ); + + if (confirmed && context.mounted) { + try { + await File(filePath).delete(); + controller.removeResultByFilePath(filePath); + notifyListeners(); + + if (context.mounted) { + Logger().info('已删除文件: $filePath'); + } + } catch (e) { + if (context.mounted) { + Logger().error('删除失败: ${e.toString()}'); + } + } + } + } + Widget _buildHighlightedText(String text, matches) { final spans = []; int lastEnd = 0; @@ -238,11 +335,13 @@ class CountDataSource extends DataGridSource { @override List get rows => - _counts.map((entry) { + _counts.asMap().entries.map((entry) { + final index = entry.key + 1; return DataGridRow( cells: [ - DataGridCell(columnName: 'keyword', value: entry.key), - DataGridCell(columnName: 'count', value: '${entry.value}'), + DataGridCell(columnName: 'index', value: index), + DataGridCell(columnName: 'keyword', value: entry.value.key), + DataGridCell(columnName: 'count', value: '${entry.value.value}'), ], ); }).toList(); @@ -254,10 +353,15 @@ class CountDataSource extends DataGridSource { row.getCells().map((cell) { return Container( alignment: cell.columnName == 'count' ? Alignment.centerRight : Alignment.centerLeft, - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric(horizontal: 8), child: Text(cell.value.toString(), overflow: TextOverflow.ellipsis, maxLines: 1), ); }).toList(), ); } } + +// 自定义Action标识类 +class _ConfirmAction extends Intent { + const _ConfirmAction(); +} diff --git a/win_text_editor/lib/modules/content_search/widgets/search_settings.dart b/win_text_editor/lib/modules/content_search/widgets/search_settings.dart index 8b558db..e78e990 100644 --- a/win_text_editor/lib/modules/content_search/widgets/search_settings.dart +++ b/win_text_editor/lib/modules/content_search/widgets/search_settings.dart @@ -266,11 +266,8 @@ class _SearchSettingsState extends State { const SizedBox(width: 8), Expanded( child: ElevatedButton.icon( - icon: const Icon(Icons.stop, size: 20), - label: const Row( - mainAxisSize: MainAxisSize.min, - children: [Text('停止')], - ), + icon: const Icon(Icons.stop, color: Colors.red), + label: const Text('停止', style: TextStyle(color: Colors.red)), onPressed: controller.isSearching ? () { @@ -278,10 +275,6 @@ class _SearchSettingsState extends State { _stopTimer(); } : null, - style: ElevatedButton.styleFrom( - backgroundColor: controller.isSearching ? Colors.red : null, - foregroundColor: controller.isSearching ? Colors.white : null, - ), ), ), ], diff --git a/win_text_editor/lib/modules/data_extract/widgets/condition_setting.dart b/win_text_editor/lib/modules/data_extract/widgets/condition_setting.dart index 1649a60..bda2d87 100644 --- a/win_text_editor/lib/modules/data_extract/widgets/condition_setting.dart +++ b/win_text_editor/lib/modules/data_extract/widgets/condition_setting.dart @@ -90,7 +90,7 @@ class _ConditionSettingState extends State { Expanded( child: ElevatedButton.icon( icon: const Icon(Icons.stop, color: Colors.red), - label: const Text('结束', style: TextStyle(color: Colors.red)), + label: const Text('停止', style: TextStyle(color: Colors.red)), onPressed: _isExtracting ? _stopExtraction : null, ), ), diff --git a/win_text_editor/lib/modules/data_extract/widgets/results_view.dart b/win_text_editor/lib/modules/data_extract/widgets/results_view.dart index f28f56a..268a1c6 100644 --- a/win_text_editor/lib/modules/data_extract/widgets/results_view.dart +++ b/win_text_editor/lib/modules/data_extract/widgets/results_view.dart @@ -44,13 +44,17 @@ class ResultsView extends StatelessWidget { position.dx + renderBox.size.width - localPosition.dx, position.dy + renderBox.size.height - localPosition.dy, ), - items: [const PopupMenuItem(value: 'export', child: Text('导出(csv)'))], + items: [ + const PopupMenuItem(value: 'exportFileName', child: Text('导出文件名(csv)')), + const PopupMenuItem(value: 'exportContent', child: Text('导出内容(csv)')), + const PopupMenuItem(value: 'exportAll', child: Text('导出全部(csv)')), + ], ); // 处理菜单选择结果 - if (result == 'export' && context.mounted) { + if (result != null && result.startsWith('export') && context.mounted) { try { - await _exportToCsv(controller); + await _exportToCsv(controller, result); } catch (e) { if (context.mounted) { ScaffoldMessenger.of( @@ -61,11 +65,23 @@ class ResultsView extends StatelessWidget { } } - Future _exportToCsv(DataExtractController controller) async { + Future _exportToCsv(DataExtractController controller, String? exportType) async { String csvData = ''; - csvData = '文件,内容\n'; + csvData = + exportType == 'exportFileName' + ? '文件名称\n' + : (exportType == 'exportContent' ? '内容\n' : '文件名称,内容\n'); for (var result in controller.results) { - csvData += '${path.basename(result.filePath)},${result.content}\n'; + switch (exportType) { + case 'exportFileName': + csvData += '${path.basename(result.filePath)}\n'; + break; + case 'exportContent': + csvData += '${result.content}\n'; + break; + default: + csvData += '${path.basename(result.filePath)},${result.content}\n'; + } } final filePath = await FilePicker.platform.saveFile( @@ -87,8 +103,8 @@ class ResultsView extends StatelessWidget { headerRowHeight: 32, source: LocateDataSource(controller), columns: [ - MyGridColumn(columnName: 'rowNum', label: '序号'), - MyGridColumn(columnName: 'file', label: '文件', minimumWidth: 300), + ShortGridColumn(columnName: 'rowNum', label: '序号'), + MyGridColumn(columnName: 'file', label: '文件名称', minimumWidth: 300), MyGridColumn(columnName: 'content', label: '内容'), ], selectionMode: SelectionMode.multiple, diff --git a/win_text_editor/lib/shared/components/my_grid_column.dart b/win_text_editor/lib/shared/components/my_grid_column.dart index d3b935a..31a24e4 100644 --- a/win_text_editor/lib/shared/components/my_grid_column.dart +++ b/win_text_editor/lib/shared/components/my_grid_column.dart @@ -14,3 +14,17 @@ class MyGridColumn extends GridColumn { ), ); } + +class ShortGridColumn extends GridColumn { + ShortGridColumn({required String columnName, double width = 60, required String label}) + : super( + columnName: columnName, + width: width, + label: Container( + alignment: Alignment.center, + color: Colors.grey[200], + padding: const EdgeInsets.all(2.0), + child: Text(label, style: const TextStyle(fontWeight: FontWeight.normal)), + ), + ); +} diff --git a/win_text_editor/pubspec.lock b/win_text_editor/pubspec.lock index 6eee4a8..cf9f0ed 100644 --- a/win_text_editor/pubspec.lock +++ b/win_text_editor/pubspec.lock @@ -6,7 +6,7 @@ packages: description: name: async sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.12.0" bitsdojo_window: @@ -14,7 +14,7 @@ packages: description: name: bitsdojo_window sha256: "88ef7765dafe52d97d7a3684960fb5d003e3151e662c18645c1641c22b873195" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.6" bitsdojo_window_linux: @@ -22,7 +22,7 @@ packages: description: name: bitsdojo_window_linux sha256: "9519c0614f98be733e0b1b7cb15b827007886f6fe36a4fb62cf3d35b9dd578ab" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.4" bitsdojo_window_macos: @@ -30,7 +30,7 @@ packages: description: name: bitsdojo_window_macos sha256: f7c5be82e74568c68c5b8449e2c5d8fd12ec195ecd70745a7b9c0f802bb0268f - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.4" bitsdojo_window_platform_interface: @@ -38,7 +38,7 @@ packages: description: name: bitsdojo_window_platform_interface sha256: "65daa015a0c6dba749bdd35a0f092e7a8ba8b0766aa0480eb3ef808086f6e27c" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.2" bitsdojo_window_windows: @@ -46,7 +46,7 @@ packages: description: name: bitsdojo_window_windows sha256: fa982cf61ede53f483e50b257344a1c250af231a3cdc93a7064dd6dc0d720b68 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.6" boolean_selector: @@ -54,7 +54,7 @@ packages: description: name: boolean_selector sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.2" characters: @@ -62,7 +62,7 @@ packages: description: name: characters sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.4.0" clock: @@ -70,7 +70,7 @@ packages: description: name: clock sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.1.2" collection: @@ -78,7 +78,7 @@ packages: description: name: collection sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.19.1" cross_file: @@ -86,7 +86,7 @@ packages: description: name: cross_file sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.3.4+2" crypto: @@ -94,7 +94,7 @@ packages: description: name: crypto sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.6" csv: @@ -102,7 +102,7 @@ packages: description: name: csv sha256: c6aa2679b2a18cb57652920f674488d89712efaf4d3fdf2e537215b35fc19d6c - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.0.0" expandable: @@ -110,7 +110,7 @@ packages: description: name: expandable sha256: "9604d612d4d1146dafa96c6d8eec9c2ff0994658d6d09fed720ab788c7f5afc2" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "5.0.1" fake_async: @@ -118,7 +118,7 @@ packages: description: name: fake_async sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.3.2" ffi: @@ -126,7 +126,7 @@ packages: description: name: ffi sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.4" file: @@ -134,7 +134,7 @@ packages: description: name: file sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "7.0.1" file_picker: @@ -142,7 +142,7 @@ packages: description: name: file_picker sha256: "77f8e81d22d2a07d0dee2c62e1dda71dc1da73bf43bb2d45af09727406167964" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "10.1.9" flutter: @@ -155,7 +155,7 @@ packages: description: name: flutter_js sha256: "0d22d73a474b5b80c3ab5508e7c3eab6fb20beea9dec45bbd21088cfd27a5e61" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.8.3" flutter_lints: @@ -163,7 +163,7 @@ packages: description: name: flutter_lints sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.3" flutter_plugin_android_lifecycle: @@ -171,7 +171,7 @@ packages: description: name: flutter_plugin_android_lifecycle sha256: f948e346c12f8d5480d2825e03de228d0eb8c3a737e4cdaa122267b89c022b5e - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.28" flutter_syntax_view: @@ -179,7 +179,7 @@ packages: description: name: flutter_syntax_view sha256: c5017bbedfdcf538daba765e16541fcb26434071655ca00cea7cbc205a70246a - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.1.7" flutter_test: @@ -197,7 +197,7 @@ packages: description: name: hive sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.2.3" hive_flutter: @@ -205,7 +205,7 @@ packages: description: name: hive_flutter sha256: dca1da446b1d808a51689fb5d0c6c9510c0a2ba01e22805d492c73b68e33eecc - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.1.0" http: @@ -213,7 +213,7 @@ packages: description: name: http sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.4.0" http_parser: @@ -221,7 +221,7 @@ packages: description: name: http_parser sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "4.1.2" leak_tracker: @@ -229,7 +229,7 @@ packages: description: name: leak_tracker sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "10.0.8" leak_tracker_flutter_testing: @@ -237,7 +237,7 @@ packages: description: name: leak_tracker_flutter_testing sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.9" leak_tracker_testing: @@ -245,7 +245,7 @@ packages: description: name: leak_tracker_testing sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.0.1" lints: @@ -253,7 +253,7 @@ packages: description: name: lints sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.1" matcher: @@ -261,7 +261,7 @@ packages: description: name: matcher sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.12.17" material_color_utilities: @@ -269,7 +269,7 @@ packages: description: name: material_color_utilities sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.11.1" meta: @@ -277,7 +277,7 @@ packages: description: name: meta sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.16.0" mustache_template: @@ -285,7 +285,7 @@ packages: description: name: mustache_template sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.0.0" nested: @@ -293,7 +293,7 @@ packages: description: name: nested sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.0.0" path: @@ -301,7 +301,7 @@ packages: description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.9.1" path_provider: @@ -309,7 +309,7 @@ packages: description: name: path_provider sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.5" path_provider_android: @@ -317,7 +317,7 @@ packages: description: name: path_provider_android sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.2.17" path_provider_foundation: @@ -325,7 +325,7 @@ packages: description: name: path_provider_foundation sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" path_provider_linux: @@ -333,7 +333,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -341,7 +341,7 @@ packages: description: name: path_provider_platform_interface sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.2" path_provider_windows: @@ -349,7 +349,7 @@ packages: description: name: path_provider_windows sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.3.0" petitparser: @@ -357,7 +357,7 @@ packages: description: name: petitparser sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.1.0" platform: @@ -365,7 +365,7 @@ packages: description: name: platform sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.1.6" plugin_platform_interface: @@ -373,7 +373,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.8" provider: @@ -381,7 +381,7 @@ packages: description: name: provider sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.1.5" screen_retriever: @@ -389,7 +389,7 @@ packages: description: name: screen_retriever sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.1.9" shared_preferences: @@ -397,7 +397,7 @@ packages: description: name: shared_preferences sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.5.3" shared_preferences_android: @@ -405,7 +405,7 @@ packages: description: name: shared_preferences_android sha256: "20cbd561f743a342c76c151d6ddb93a9ce6005751e7aa458baad3858bfbfb6ac" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.10" shared_preferences_foundation: @@ -413,7 +413,7 @@ packages: description: name: shared_preferences_foundation sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.5.4" shared_preferences_linux: @@ -421,7 +421,7 @@ packages: description: name: shared_preferences_linux sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" shared_preferences_platform_interface: @@ -429,7 +429,7 @@ packages: description: name: shared_preferences_platform_interface sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" shared_preferences_web: @@ -437,7 +437,7 @@ packages: description: name: shared_preferences_web sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.3" shared_preferences_windows: @@ -445,7 +445,7 @@ packages: description: name: shared_preferences_windows sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.4.1" sky_engine: @@ -458,7 +458,7 @@ packages: description: name: source_span sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.10.1" stack_trace: @@ -466,7 +466,7 @@ packages: description: name: stack_trace sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.12.1" stream_channel: @@ -474,7 +474,7 @@ packages: description: name: stream_channel sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.4" string_scanner: @@ -482,7 +482,7 @@ packages: description: name: string_scanner sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.4.1" sync_http: @@ -490,7 +490,7 @@ packages: description: name: sync_http sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.3.1" syncfusion_flutter_core: @@ -498,7 +498,7 @@ packages: description: name: syncfusion_flutter_core sha256: a2427697bfad5b611db78ea4c4daef82d3350b83c729a8dc37959662a31547f9 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "23.2.7" syncfusion_flutter_datagrid: @@ -506,7 +506,7 @@ packages: description: name: syncfusion_flutter_datagrid sha256: "9f621f6344d2ed7ea3a8d0ff5c145c174f1e227d6d8851290591ceb718e44600" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "23.2.7" term_glyph: @@ -514,7 +514,7 @@ packages: description: name: term_glyph sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.2.2" test_api: @@ -522,7 +522,7 @@ packages: description: name: test_api sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.7.4" typed_data: @@ -530,7 +530,7 @@ packages: description: name: typed_data sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.4.0" vector_math: @@ -538,7 +538,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "2.1.4" vm_service: @@ -546,7 +546,7 @@ packages: description: name: vm_service sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "14.3.1" web: @@ -554,7 +554,7 @@ packages: description: name: web sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.1.1" win32: @@ -562,7 +562,7 @@ packages: description: name: win32 sha256: "329edf97fdd893e0f1e3b9e88d6a0e627128cc17cc316a8d67fda8f1451178ba" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "5.13.0" window_manager: @@ -570,7 +570,7 @@ packages: description: name: window_manager sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "0.3.9" xdg_directories: @@ -578,7 +578,7 @@ packages: description: name: xdg_directories sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "1.1.0" xml: @@ -586,7 +586,7 @@ packages: description: name: xml sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "6.5.0" yaml: @@ -594,9 +594,8 @@ packages: description: name: yaml sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce - url: "https://pub.flutter-io.cn" + url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" source: hosted version: "3.1.3" sdks: dart: ">=3.7.0 <4.0.0" - flutter: ">=3.27.0" diff --git a/win_text_editor/pubspec.yaml b/win_text_editor/pubspec.yaml index 5ad7e00..6b2bba6 100644 --- a/win_text_editor/pubspec.yaml +++ b/win_text_editor/pubspec.yaml @@ -27,6 +27,7 @@ dependencies: hive: ^2.2.3 hive_flutter: ^1.1.0 yaml: ^3.1.1 + dev_dependencies: flutter_test: