Merge pull request #3234 from pangeachat/3233-when-the-word-card-is-open-clicking-one-word-after-another-doesnt-change-the-phonetic-transcription
chore: update phonetic transcription when text changes
This commit is contained in:
commit
bfcbb6a18a
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