chore: update phonetic transcription when text changes
This commit is contained in:
parent
a71a5f2ddb
commit
4c11a2a079
1 changed files with 11 additions and 0 deletions
|
|
@ -51,6 +51,17 @@ class _PhoneticTranscriptionWidgetState
|
|||
_fetchTranscription();
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(
|
||||
covariant PhoneticTranscriptionWidget oldWidget,
|
||||
) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.text != widget.text ||
|
||||
oldWidget.textLanguage != widget.textLanguage) {
|
||||
_fetchTranscription();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _fetchTranscription() async {
|
||||
try {
|
||||
setState(() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue