Commit Graph

11 Commits

Author SHA1 Message Date
Max 4817b1c8f8 chore(release): 1.0.5
Improve init responsiveness with recognizer isolate; update RecordingButton lazy-init UX
2026-01-17 23:48:36 +08:00
Max e961996ec6 Remove recognition history functionality
Complete removal of recognition history features:

1. State Variables Removed:
   - _recognitionHistory list variable
   - _realtimeResults list variable
   - All history-related state management

2. Methods Updated:
   - _clearHistory() renamed to _clearContent()
   - Simplified to only clear current text and base text
   - Removed history list operations

3. UI Components Removed:
   - _buildHistoryCard() method completely removed
   - History card from main layout removed
   - History-related ListView and ListTile widgets removed

4. Callback Logic Simplified:
   - onListeningStatusChanged callback cleaned up
   - Removed history insertion logic when recording stops
   - Removed _realtimeResults.clear() operations
   - Simplified state management to focus only on current text

5. App Bar Updated:
   - Clear button tooltip changed from '清除历史' to '清除内容'
   - Button now calls _clearContent() instead of _clearHistory()

The app now focuses purely on real-time speech recognition with
editable text input, without maintaining any recognition history.
This simplifies the codebase and improves performance by removing
unnecessary data storage and UI rendering.
2025-09-09 16:22:38 +08:00
Max 0af37c5b87 Remove final result logic from SDK library
Major SDK simplification by removing redundant final result processing:

1. YxAsrService changes:
   - Remove final result retrieval in stopListening()
   - Remove finalResult parameter from _sendResult()
   - Simplify stop logic to only reset stream state
   - Eliminate duplicate API calls that provided no additional value

2. SpeechRecognitionResult model changes:
   - Remove finalResult property and related logic
   - Update constructor, factory methods, toString, equals, hashCode
   - Remove finalResult from toMap/fromMap serialization
   - Simplify the model to focus on actual recognition data

3. Benefits:
   - Cleaner, more maintainable codebase
   - Reduced complexity and potential bugs
   - Better performance (no redundant API calls)
   - Simpler API for developers to use
   - Real-time text appending works seamlessly without artificial distinctions

The analysis showed that 'final results' were identical to the last real-time result,
making the distinction unnecessary. Now all results are treated uniformly as
real-time updates, providing a smoother and more intuitive user experience.
2025-09-09 11:29:19 +08:00
Max ed51fa89bd Implement real-time text appending to input field
1. Add _baseText variable to track text before recording starts
   - Preserves existing text when starting new recording session
   - Provides foundation for real-time appending

2. Update real-time result processing logic
   - Real-time results now immediately update the text field
   - Combine base text + current recognition text
   - Move cursor to end for better UX
   - Add intelligent spacing between segments

3. Improve final result handling
   - Final results update base text for next recording
   - Clean state management between recording sessions

4. Update recording status change logic
   - Capture base text when recording starts
   - Maintain proper state transitions

Now users can see their speech being converted to text in real-time directly in the input field, providing immediate visual feedback during speech recognition.
2025-09-09 11:24:53 +08:00
Max d1ab67e60e Fix real-time speech recognition display
1. Update UI to show actual _currentText instead of fixed 'realtime recognizing...' text
   - Use Flexible widget to handle text overflow
   - Show actual recognition text when available
   - Fallback to 'realtime recognizing...' when text is empty

2. Fix final result processing logic
   - Don't update _currentText when processing final results
   - Final results only append to text field, don't interfere with real-time display

3. Improve listening status management
   - Clear _currentText when recording stops
   - Ensure clean state transitions between recording sessions

This fixes the issue where users could only see final results without real-time feedback.
2025-09-09 11:22:37 +08:00
Max d63124203b Fix critical bugs in speech recognition system
1. Add finalResult property to SpeechRecognitionResult class
   - Distinguish between real-time and final recognition results
   - Update factory methods, toString, equals, and hashCode
   - Update toMap and fromMap methods

2. Update YxAsrService to support finalResult flag
   - Add finalResult parameter to _sendResult method
   - Mark final results with finalResult: true
   - Keep real-time results as finalResult: false (default)

3. Remove unused methods to clean up codebase
   - Remove unused _toggleRecording method
   - Remove unused _updateTextController method
   - Clean up orphaned comments

These fixes resolve linter errors and ensure proper text appending functionality.
2025-09-09 11:17:13 +08:00
Max ea32370fcc Improve text input behavior: append recognition results to text field
- Change from replacing current text to appending final results
- Distinguish between real-time results (display only) and final results (append to text)
- Add proper spacing between appended text segments
- Maintain history of individual recognition segments
- Clear current text when starting new recording session
2025-09-09 11:08:44 +08:00
Max 36fa796c10 Improve demo: use RecordingButton component instead of custom implementation
- Replace custom FloatingActionButton with RecordingButton widget
- Simplify code by using built-in speech recognition integration
- Demonstrate proper usage of RecordingButton component
- Reduce demo code complexity from 80+ lines to ~40 lines
- Better showcase the plugin's provided components
2025-09-09 11:04:27 +08:00
Max d18c3fc607 Switch back to zh2023 model to fix filename mismatch issue 2025-09-06 17:30:54 +08:00
Max 9053132874 Fix model loading: switch to zh2025 model as recommended by logs 2025-09-06 17:29:11 +08:00
Max 5c9a8ea6e6 Initial commit: Flutter speech-to-text plugin with Sherpa-ONNX integration 2025-08-27 17:09:36 +08:00