Enable customisable styling for WaveformRecorder via VoiceNoteRecorderStyle #161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refined PR Summary
This PR introduces a new
VoiceNoteRecorderStyle
class and integrates it into the chat input system to provide configurable styling for the waveform recorder component. The changes centralize waveform recorder styling configuration and eliminate hardcoded values.Changes Made
1. Added VoiceNoteRecorderStyle class (
lib/src/styles/waveform_recorder_style.dart
)height
,waveColor
, anddurationTextStyle
propertiesresolve()
factory method for handling null checks and fallback valuesdefaultStyle()
factory with sensible defaults (height: 48.0, black color)2. Integrated VoiceNoteRecorderStyle into LlmChatViewStyle
voiceNoteRecorderStyle
property toLlmChatViewStyle
resolve()
method to handle the new style propertydefaultStyle()
factory3. Updated TextOrAudioInput widget
voiceNoteRecorderStyle
parameter to constructorheight: _minInputHeight
withheight: _voiceNoteRecorderStyle.height!
waveColor
anddurationTextStyle
properties from the style object4. Updated ChatInput widget
voiceNoteRecorderStyle
from_chatStyle
toTextOrAudioInput
5. Updated example app
VoiceNoteRecorderStyle
configuration with custom height (60.0), orange wave color, and custom text style6. Updated exports
waveform_recorder_style.dart
tolib/src/styles/styles.dart
exportsBefore/After Comparison
This refactoring improves maintainability by centralizing waveform recorder styling configuration and makes the component more customizable for different use cases.