-
Notifications
You must be signed in to change notification settings - Fork 383
feat(ui): integrate StreamSnackbar into composer hold-to-record #2739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
8b5798c
00ad05d
5dacd58
90c5e38
32d3540
b00a000
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,6 +174,7 @@ class StreamAudioRecorderController extends ValueNotifier<AudioRecorderState> { | |
| /// Shows an info message to the user for the given [duration]. | ||
| /// | ||
| /// This is useful for showing messages like "Hold to record" or "Recording". | ||
| @Deprecated('Use StreamSnackbar via StreamSnackbarMessenger instead.') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we still use this state, but just use this state to show a self-controllled snackbar? This way we're immediately breaking potential custom implementations.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, but it will be a tech debt for us, but i get your point |
||
| void showInfo( | ||
| String message, { | ||
| Duration duration = const Duration(seconds: 3), | ||
|
|
@@ -198,6 +199,18 @@ class StreamAudioRecorderController extends ValueNotifier<AudioRecorderState> { | |
| } | ||
| } | ||
|
|
||
| /// Cancels any pending info-message timer and clears the message on | ||
| /// [RecordStateIdle]. Counterpart to [showInfo]. | ||
| @Deprecated('Use StreamSnackbar via StreamSnackbarMessenger instead.') | ||
| void hideInfo() { | ||
| // Cancel the info timer. | ||
| _infoTimer?.cancel(); | ||
| _infoTimer = null; | ||
|
|
||
| // Clear the info message if it is currently being shown. | ||
| if (value case RecordStateIdle()) value = const RecordStateIdle(); | ||
| } | ||
|
|
||
| Future<String> _getOutputFilePath(AudioEncoder encoder) async { | ||
| // Ignored on web platform. | ||
| if (CurrentPlatform.isWeb) return ''; | ||
|
|
@@ -232,6 +245,8 @@ class StreamAudioRecorderController extends ValueNotifier<AudioRecorderState> { | |
| void dispose() { | ||
| _durationTimer?.cancel(); | ||
| _durationTimer = null; | ||
| _infoTimer?.cancel(); | ||
| _infoTimer = null; | ||
| _recorderAmplitudeSubscription?.cancel(); | ||
| _recorder.dispose(); | ||
| super.dispose(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snapshot in the docs tests is broken