Fix audio not showing (empty list)
This commit is contained in:
parent
3186a0dd8e
commit
144722feea
@ -53,19 +53,23 @@ class MultiStringContainer extends StatelessWidget {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
List<TranslationDTO> newValues = <TranslationDTO>[];
|
List<TranslationDTO> newValues = <TranslationDTO>[];
|
||||||
if(initialValue.isNotEmpty) {
|
|
||||||
|
|
||||||
languages.forEach((value) {
|
List<TranslationDTO> initials = initialValue;
|
||||||
if(initialValue.map((iv) => iv.language).contains(value)) {
|
if(initials == null) {
|
||||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initialValue.firstWhere((element) => element.language == value)))));
|
initials = [];
|
||||||
} else {
|
|
||||||
// New language
|
|
||||||
newValues.add(TranslationDTO(language: value, value: null));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
showMultiStringInput(label, modalLabel, isTitle, initialValue, newValues, onGetResult, maxLines, isAudio, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
languages.forEach((value) {
|
||||||
|
if(initials.map((iv) => iv.language).contains(value)) {
|
||||||
|
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initials.firstWhere((element) => element.language == value)))));
|
||||||
|
} else {
|
||||||
|
// New language
|
||||||
|
newValues.add(TranslationDTO(language: value, value: null));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
showMultiStringInput(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, isAudio, context);
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user