$ show yaoyao2mm/cheatreader
CheatReader is a Flutter-based desktop ebook reader designed for low-distraction reading. It provides a floating, always-on-top window that supports single-line and multi-line reading modes, transparency, a boss key for quick hide/restore, system tray integration, and app disguise (icon/name change). The application imports local files in multiple formats (txt, epub, html, md, fb2, docx, pdf) via text extraction, never modifying the source. It features a bookshelf with reading progress tracking, customizable keyboard shortcuts, auto page-turn, full-text search, and a control panel for all settings. The architecture is a standard Flutter app with platform-specific abstractions for window management, file import, and startup behavior, targeting Windows, macOS, and Linux. The codebase is well-tested, localized in English and Chinese, and uses a spec-driven development process (OpenSpec). While the main reader surface widget is large (~2600 lines), the overall structure demonstrates solid engineering with reusable patterns for platform abstraction, settings persistence, and text extraction.
The LLM identified 4 files worth highlighting for reuse:
Provides a unified interface for desktop window operations (show, focus, hide, set always-on-top, hide taskbar icon, system tray) across Windows, macOS, and Linux. It isolates platform-specific code behind a clean abstraction, making it reusable for any Flutter desktop app that needs advanced window control. The implementation uses platform channels and native APIs, and the interface is testable via a stub.
Handles importing and extracting text from multiple ebook formats (txt, epub, html, md, fb2, docx, pdf) with automatic encoding detection (UTF-8, UTF-16, GBK). The service is designed as an abstract interface with platform-specific implementations, making it reusable for any application that needs to extract plain text from various document formats. The encoding scoring and fallback logic demonstrate non-obvious data engineering skill.
Defines a system for customizable keyboard shortcuts with JSON serialization, conflict detection, and modifier key support. The `ReaderShortcutKey` and `ReaderShortcutBindings` classes are self-contained and could be extracted into a general-purpose shortcut configuration library for any Flutter desktop app. The design supports runtime rebinding and persistence.
Implements text wrapping into visual lines for single-line reading mode, handling edge cases like punctuation, whitespace, and line breaks. The algorithm is isolated and could be reused in any text display widget that needs to segment text into lines of a given width. It demonstrates careful attention to typographic details.