Skip to content

Commit f426398

Browse files
committedJan 20, 2025·
feat: optimize log viewer with chunked loading and auto-scroll
- Implement chunked loading for large log files - Add auto-scroll toggle with immediate scroll to bottom
1 parent e7e8f1e commit f426398

File tree

4 files changed

+269
-81
lines changed

4 files changed

+269
-81
lines changed
 

‎lib/common/controller/log_controller.dart

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ const _kSuffix = '.log';
1414
class LogService extends GetxController {
1515
final logFiles = <File>[].obs;
1616

17+
// 添加自动滚动控制
18+
final _autoScroll = true.obs;
19+
bool get autoScroll => _autoScroll.value;
20+
set autoScroll(bool val) => _autoScroll.value = val;
21+
1722
final _curFileName = 'eh.log'.obs;
1823
String get curFileName => _curFileName.value;
1924
set curFileName(String val) => _curFileName.value = val;

‎lib/main.dart

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
180180
@override
181181
void dispose() {
182182
WidgetsBinding.instance.removeObserver(this);
183+
_listener.dispose();
183184
super.dispose();
184185
}
185186

0 commit comments

Comments
 (0)
Please sign in to comment.