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(
|
||||
onTap: () {
|
||||
List<TranslationDTO> newValues = <TranslationDTO>[];
|
||||
if(initialValue.isNotEmpty) {
|
||||
|
||||
List<TranslationDTO> initials = initialValue;
|
||||
if(initials == null) {
|
||||
initials = [];
|
||||
}
|
||||
|
||||
languages.forEach((value) {
|
||||
if(initialValue.map((iv) => iv.language).contains(value)) {
|
||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initialValue.firstWhere((element) => element.language == 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, initialValue, newValues, onGetResult, maxLines, isAudio, context);
|
||||
}
|
||||
showMultiStringInput(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, isAudio, context);
|
||||
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user