Fix audio translate bug
This commit is contained in:
parent
4dbbd2a335
commit
8e8be6726b
@ -56,19 +56,14 @@ class MultiStringContainer extends StatelessWidget {
|
||||
if(initialValue.isNotEmpty) {
|
||||
|
||||
languages.forEach((value) {
|
||||
if(initialValue.contains(value)) {
|
||||
if(initialValue.map((iv) => iv.language).contains(value)) {
|
||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initialValue.firstWhere((element) => element.language == value)))));
|
||||
} else {
|
||||
// New language
|
||||
newValues.add(TranslationDTO(language: value));
|
||||
newValues.add(TranslationDTO(language: value, value: null));
|
||||
}
|
||||
});
|
||||
|
||||
// Make a copy
|
||||
initialValue.forEach((value) {
|
||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));
|
||||
});
|
||||
|
||||
showMultiStringInput(label, modalLabel, isTitle, initialValue, newValues, onGetResult, maxLines, isAudio, context);
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user