_filterNotes was calling note.readAsStringSync() and _extractTags() for every note on every keystroke, plus recomputing path.relative() each time. For large collections with many subdirectories this is O(n * disk). Fix: build three maps during _loadNotes (which already reads every file once) and use them in _filterNotes instead of touching the filesystem: - _noteRelativePaths: pre-lowercased relative path per note - _noteContentLower: pre-lowercased content for full-text search - noteTags: already existed, now actually used in filter _filterNotes now does only in-memory map lookups and string.contains checks — no file reads, no regex, no path computation per keystroke. Also fix _createNewNote: the Navigator.push was not awaited so _loadNotes() was never called on return, leaving stale caches after editing a freshly created note. Now awaits the push and reloads on return, mirroring the existing-note tap behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| themes | ||
| codefield.dart | ||
| main.dart | ||
| note_editor.dart | ||
| note_list.dart | ||
| read_only.dart | ||
| texts.dart | ||