+
Skip to content

Conversation

csongorkeller
Copy link

@csongorkeller csongorkeller commented Sep 16, 2025

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)

  • New style class with height, waveColor, and durationTextStyle properties
  • Includes resolve() factory method for handling null checks and fallback values
  • Provides defaultStyle() factory with sensible defaults (height: 48.0, black color)

2. Integrated VoiceNoteRecorderStyle into LlmChatViewStyle

  • Added voiceNoteRecorderStyle property to LlmChatViewStyle
  • Updated resolve() method to handle the new style property
  • Added default style to defaultStyle() factory

3. Updated TextOrAudioInput widget

  • Added voiceNoteRecorderStyle parameter to constructor
  • Replaced hardcoded height: _minInputHeight with height: _voiceNoteRecorderStyle.height!
  • Added waveColor and durationTextStyle properties from the style object
  • Updated constructor documentation

4. Updated ChatInput widget

  • Pass voiceNoteRecorderStyle from _chatStyle to TextOrAudioInput

5. Updated example app

  • Added example VoiceNoteRecorderStyle configuration with custom height (60.0), orange wave color, and custom text style

6. Updated exports

  • Added waveform_recorder_style.dart to lib/src/styles/styles.dart exports

Before/After Comparison

// Before - hardcoded values
WaveformRecorder(
  controller: _waveController,
  height: _minInputHeight,  // hardcoded 48.0
  onRecordingStopped: _onRecordingStopped,
)

// After - configurable styling
WaveformRecorder(
  controller: _waveController,
  height: _voiceNoteRecorderStyle.height!,
  waveColor: _voiceNoteRecorderStyle.waveColor!,
  durationTextStyle: _voiceNoteRecorderStyle.durationTextStyle!,
  onRecordingStopped: _onRecordingStopped,
)

This refactoring improves maintainability by centralizing waveform recorder styling configuration and makes the component more customizable for different use cases.

Copy link

google-cla bot commented Sep 16, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@csongorkeller
Copy link
Author

I signed the CLA just now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载