1027 play button for listening activity (#1031)
* close audio player button if error occurs * dump version
This commit is contained in:
parent
f26c7e76e1
commit
d0733cf8fa
2 changed files with 14 additions and 8 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/widgets/chat/tts_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
|
|
@ -47,13 +48,18 @@ class WordAudioButtonState extends State<WordAudioButton> {
|
|||
if (mounted) {
|
||||
setState(() => _isPlaying = true);
|
||||
}
|
||||
await widget.ttsController.tryToSpeak(
|
||||
widget.text,
|
||||
context,
|
||||
widget.eventID,
|
||||
);
|
||||
if (mounted) {
|
||||
setState(() => _isPlaying = false);
|
||||
try {
|
||||
await widget.ttsController.tryToSpeak(
|
||||
widget.text,
|
||||
context,
|
||||
widget.eventID,
|
||||
);
|
||||
} catch (e, s) {
|
||||
ErrorHandler.logError(e: e, s: s);
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _isPlaying = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, // Disable button if language isn't supported
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
|
|||
# Pangea#
|
||||
publish_to: none
|
||||
# On version bump also increase the build number for F-Droid
|
||||
version: 1.23.7+3566
|
||||
version: 1.23.8+3567
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue