WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## [3.0.0] (unreleased)
## [3.0.0]

* **Feat**: [401](https://github.com/SimformSolutionsPvtLtd/chatview/pull/401)
Add selection and copy options for text view.
* **Breaking**: [318](https://github.com/SimformSolutionsPvtLtd/chatview/issues/318)
Expand Down Expand Up @@ -53,6 +54,11 @@
* **Breaking**: [390](https://github.com/SimformSolutionsPvtLtd/chatview/pull/390) `playIcon` and
`pauseIcon` Now accepts a callback that provides different icons based on whether the message is
by the sender or not. accept `Widget`.
* **Feat**: [390](https://github.com/SimformSolutionsPvtLtd/chatview/pull/406) Updated
audio_waveforms version to `2.0.0`
* **Breaking**: [390](https://github.com/SimformSolutionsPvtLtd/chatview/pull/406) Moved recording
audio settings from `VoiceRecordingConfiguration` to `RecorderSettings`. Check out the migration
guide [here](https://simform-flutter-packages.web.app/chatView/migration-guide).

## [2.5.0]

Expand Down
39 changes: 39 additions & 0 deletions doc/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,45 @@ This guide will help you migrate your code from previous versions of ChatView to

## Key Changes

### Voice Recording Configuration

The `VoiceRecordingConfiguration` class has been updated to utilize `RecorderSettings`, which now
encapsulates the recorder settings for both iOS and Android platforms. The `androidOutputFormat`
property has been removed so whatever format will be given by the encoder that will be used.

Previous Usage:
```dart
ChatView(
sendMessageConfig: SendMessageConfiguration(
voiceRecordingConfiguration: VoiceRecordingConfiguration(
sampleRate: 44100,
bitRate: 128000,
iosEncoder: IosEncoder.kAudioFormatMPEG4AAC,
androidEncoder: AndroidEncoder.aacLc,
androidOutputFormat: AndroidOutputFormat.mpeg4,
),
),
```

New Usage:
```dart
ChatView(
sendMessageConfig: SendMessageConfiguration(
voiceRecordingConfiguration: VoiceRecordingConfiguration(
recorderSettings: RecorderSettings(
bitRate: 128000,
sampleRate: 44100,
androidEncoderSettings: AndroidEncoderSettings(
androidEncoder: AndroidEncoder.aacLc,
),
iosEncoderSettings: IosEncoderSetting(
iosEncoder: IosEncoder.kAudioFormatMPEG4AAC,
),
),
),
),
```

### Text Field Action Items

You can now add action buttons to the input field using two builders:
Expand Down
7 changes: 2 additions & 5 deletions example/lib/widgets/custom_chat_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,8 @@ class _CustomChatBarState extends State<CustomChatBar> {
Future<void> _recordOrStop() async {
if (!isRecording.value) {
await controller?.record(
sampleRate: voiceRecordingConfig.sampleRate,
bitRate: voiceRecordingConfig.bitRate,
androidEncoder: voiceRecordingConfig.androidEncoder,
iosEncoder: voiceRecordingConfig.iosEncoder,
androidOutputFormat: voiceRecordingConfig.androidOutputFormat,
recorderSettings:
voiceRecordingConfig.recorderSettings ?? const RecorderSettings(),
);
isRecording.value = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
sdk: flutter
cupertino_icons: ^1.0.5
flutter_svg: ^2.2.1
audio_waveforms: ^1.3.0
audio_waveforms: ^2.0.0
chatview:
path: ../
intl:
Expand Down
4 changes: 3 additions & 1 deletion lib/chatview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ library chatview;
export 'package:audio_waveforms/audio_waveforms.dart'
show
AndroidEncoder,
AndroidOutputFormat,
AndroidEncoderSettings,
IosEncoder,
IosEncoderSetting,
PlayerWaveStyle,
RecorderSettings,
WaveStyle;
export 'package:chatview_utils/chatview_utils.dart'
hide
Expand Down
28 changes: 5 additions & 23 deletions lib/src/models/config_models/send_message_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class VoiceRecordingConfiguration {
/// Styling configuration for the recorder widget as well as
/// configuring the audio recording quality.
const VoiceRecordingConfiguration({
this.recorderSettings,
this.waveStyle,
this.padding,
this.margin,
Expand All @@ -279,11 +280,6 @@ class VoiceRecordingConfiguration {
this.micIcon,
this.recorderIconColor,
this.stopIcon,
this.sampleRate,
this.bitRate,
this.androidEncoder,
this.iosEncoder,
this.androidOutputFormat,
});

/// Applies styles to waveform.
Expand Down Expand Up @@ -311,24 +307,10 @@ class VoiceRecordingConfiguration {
/// Applies color to mic and stop icon.
final Color? recorderIconColor;

/// The sample rate for audio is measured in samples per second.
/// A higher sample rate generates more samples per second,
/// resulting in better audio quality but also larger file sizes.
final int? sampleRate;

/// Bitrate is the amount of data per second that the codec uses to
/// encode the audio. A higher bitrate results in better quality
/// but also larger file sizes.
final int? bitRate;

/// Audio encoder to be used for recording for IOS.
final IosEncoder? iosEncoder;

/// Audio encoder to be used for recording for Android.
final AndroidEncoder? androidEncoder;

/// The audio output format to be used for recorded audio files on Android.
final AndroidOutputFormat? androidOutputFormat;
/// Configures audio recording settings for Android and iOS.
///
/// if null, default settings will be used.
final RecorderSettings? recorderSettings;
}

class CancelRecordConfiguration {
Expand Down
7 changes: 2 additions & 5 deletions lib/src/widgets/chatui_textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,8 @@ class _ChatUITextFieldState extends State<ChatUITextField> {
);
if (!isRecording.value) {
await controller?.record(
sampleRate: voiceRecordingConfig?.sampleRate,
bitRate: voiceRecordingConfig?.bitRate,
androidEncoder: voiceRecordingConfig?.androidEncoder,
iosEncoder: voiceRecordingConfig?.iosEncoder,
androidOutputFormat: voiceRecordingConfig?.androidOutputFormat,
recorderSettings:
voiceRecordingConfig?.recorderSettings ?? const RecorderSettings(),
);
isRecording.value = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ environment:

dependencies:
any_link_preview: ^3.0.2
audio_waveforms: ^1.2.0
audio_waveforms: ^2.0.0
cached_network_image: ^3.4.1
chatview_utils: ^0.0.2

Expand Down