File tree Expand file tree Collapse file tree 8 files changed +29
-19
lines changed
packages/stream_chat_flutter Expand file tree Collapse file tree 8 files changed +29
-19
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,8 @@ class _AudioPlayerMessageState extends State<AudioPlayerMessage> {
129
129
builder: (context, snapshot) {
130
130
final state = snapshot.data ?? ProcessingState .idle;
131
131
if (state == ProcessingState .ready ||
132
- state == ProcessingState .idle) {
132
+ state == ProcessingState .idle ||
133
+ ! playingThis) {
133
134
return ElevatedButton (
134
135
style: ElevatedButton .styleFrom (
135
136
elevation: 2 ,
Original file line number Diff line number Diff line change @@ -6,19 +6,23 @@ import 'package:just_audio/just_audio.dart';
6
6
import 'package:stream_chat_flutter/src/attachment/audio/audio_player_attachment.dart' ;
7
7
import 'package:stream_chat_flutter/stream_chat_flutter.dart' ;
8
8
9
- /// Docs
9
+ /// {@template audioListPlayer}
10
+ /// AudioPlayer intended to be used inside message composer. This audio player
11
+ /// plays only one music at a time.
12
+ /// {@endtemplate}
10
13
class AudioPlayerComposeMessage extends StatefulWidget {
11
- /// Docs
14
+ /// {@macro audioListPlayer}
12
15
const AudioPlayerComposeMessage ({
13
16
super .key,
14
17
required this .attachment,
15
18
this .actionButton,
16
19
});
17
20
18
- /// Docs
21
+ /// Attachment of the audio
19
22
final Attachment attachment;
20
23
21
- /// Docs
24
+ /// An action button to that can be used to perform actions. Example: Delete
25
+ /// audio from compose.
22
26
final Widget ? actionButton;
23
27
24
28
@override
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ import 'package:stream_chat_flutter/src/attachment/audio/wave_bars_normalizer.da
8
8
import 'package:stream_chat_flutter/stream_chat_flutter.dart' ;
9
9
10
10
/// {@template recordController}
11
- /// Controller of audio record
11
+ /// Controller of audio record. This call can be used to controll the recording
12
+ /// logic programmatically.
12
13
/// {@endtemplate}
13
14
class StreamRecordController {
14
15
/// {@macro WaveBarsNormalizer}
@@ -34,7 +35,7 @@ class StreamRecordController {
34
35
/// A Stream that provides the amplitude variation of the record.
35
36
Stream <Amplitude > get amplitudeStream => _amplitudeController.stream;
36
37
37
- /// Docs
38
+ /// Initialization of the controller.
38
39
void init () {
39
40
_amplitudeSink = _amplitudeController.sink;
40
41
_amplitudeSink? .addStream (
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class OnPressButton extends StatelessWidget {
86
86
/// The action to perform when the button is pressed or clicked.
87
87
final VoidCallback onPressed;
88
88
89
- ///Docs
89
+ /// Padding of button.
90
90
final EdgeInsetsGeometry ? padding;
91
91
92
92
/// Returns a copy of this object with the given fields updated.
Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:stream_chat_flutter/src/misc/stream_svg_icon.dart' ;
3
3
4
- ///Docs
4
+ /// {@template recordButton}
5
+ /// Record button that start the recording process. This button doesn't have
6
+ /// any logic related to recording, this should be provided in the callbacks.
7
+ /// This button allows to set callback to onHold and onPressed.
8
+ /// {@endtemplate}
5
9
class RecordButton extends StatelessWidget {
6
- ///Docs
10
+ /// {@macro recordButton}
7
11
const RecordButton ({
8
12
super .key,
9
13
required this .icon,
@@ -34,7 +38,7 @@ class RecordButton extends StatelessWidget {
34
38
/// Icon of the button.
35
39
final Widget icon;
36
40
37
- ///Docs
41
+ /// Padding of button
38
42
final EdgeInsetsGeometry ? padding;
39
43
40
44
/// Returns a copy of this object with the given fields updated.
Original file line number Diff line number Diff line change @@ -6,9 +6,12 @@ import 'package:stream_chat_flutter/src/message_input/on_press_button.dart';
6
6
import 'package:stream_chat_flutter/src/message_input/record/record_timer_widget.dart' ;
7
7
import 'package:stream_chat_flutter/stream_chat_flutter.dart' ;
8
8
9
- ///Docs
9
+ /// {@template recordField}
10
+ /// Record field. The version of text input of StreamMessageInput, but for
11
+ /// recording audio messages.
12
+ /// {@endtemplate}
10
13
class RecordField extends StatelessWidget {
11
- ///Docs
14
+ /// {@macro recordField}
12
15
const RecordField ({
13
16
super .key,
14
17
required this .recordController,
@@ -21,7 +24,7 @@ class RecordField extends StatelessWidget {
21
24
this .onAudioRecorded,
22
25
});
23
26
24
- ///Docs
27
+ /// Controller of record.
25
28
final StreamRecordController recordController;
26
29
27
30
/// Builder for customizing the resumeRecord button.
Original file line number Diff line number Diff line change @@ -361,7 +361,7 @@ class StreamMessageInputState extends State<StreamMessageInput>
361
361
_controller = StreamRestorableMessageInputController (message: message);
362
362
}
363
363
364
- void _createLocalRecordController ([ Message ? message] ) {
364
+ void _createLocalRecordController () {
365
365
_recordControllerInstance = StreamRecordController (audioRecorder: Record ());
366
366
}
367
367
Original file line number Diff line number Diff line change @@ -13,10 +13,7 @@ class MockRecorder extends Mock implements Record {
13
13
}
14
14
15
15
class MockStreamRecordController extends Mock
16
- implements StreamRecordController {
17
-
18
-
19
- }
16
+ implements StreamRecordController {}
20
17
21
18
class MockClient extends Mock implements StreamChatClient {
22
19
MockClient () {
You can’t perform that action at this time.
0 commit comments