diff --git a/lib/Components/multi_string_input_container.dart b/lib/Components/multi_string_input_container.dart index 36050e1..a34db45 100644 --- a/lib/Components/multi_string_input_container.dart +++ b/lib/Components/multi_string_input_container.dart @@ -51,11 +51,13 @@ class MultiStringContainer extends StatelessWidget { child: InkWell( onTap: () { List newValues = []; - // Make a copy - initialValue.forEach((value) { - newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value)))); - }); - showMultiStringInput(label, modalLabel, isTitle, initialValue, newValues, onGetResult, maxLines, context); + if(initialValue.isNotEmpty) { + // Make a copy + initialValue.forEach((value) { + newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value)))); + }); + showMultiStringInput(label, modalLabel, isTitle, initialValue, newValues, onGetResult, maxLines, context); + } }, child: Container( decoration: BoxDecoration( diff --git a/lib/Helpers/PDFHelper.dart b/lib/Helpers/PDFHelper.dart index 3a6348f..e55b820 100644 --- a/lib/Helpers/PDFHelper.dart +++ b/lib/Helpers/PDFHelper.dart @@ -9,10 +9,11 @@ class PDFHelper { static downloadPDF(List sections) async { var sectionsArticle = sections.where((section) => section.type == SectionType.article); if(sectionsArticle.length > 0) { - final font = await rootBundle.load("fonts/OpenSans-Medium.ttf"); + //final font = await rootBundle.load("fonts/OpenSans-Medium.ttf"); + //Uint8List byteData = new File("fonts/OpenSans-Medium.ttf").readAsBytesSync(); + //ByteData font = ByteData.view(byteData.buffer); //final ttf = pw.Font.ttf(font); final pdf = pw.Document(); - pdf.addPage(pw.MultiPage( pageFormat: PdfPageFormat.a4, build: (pw.Context context) { @@ -22,7 +23,7 @@ class PDFHelper { child: pw.Column( children: [ - pw.Text(section.label, style: pw.TextStyle(fontSize: 30)), //font: ttf, + pw.Text(section.label), //style: pw.TextStyle(font: ttf, fontSize: 30) pw.Padding(padding: const pw.EdgeInsets.only(top: 20)), pw.BarcodeWidget( data: section.id, diff --git a/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart b/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart index fb4f4cb..2727174 100644 --- a/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart @@ -141,6 +141,11 @@ class _ArticleConfigState extends State { testToSend = testToSend.where((element) => element.source_ != null).toList(); var articleToSend = new ArticleDTO(); articleToSend.images = testToSend; + articleToSend.audioId = articleDTO.audioId; + articleToSend.isContentTop = articleDTO.isContentTop; + articleToSend.content = articleDTO.content; + articleToSend.isReadAudioAuto = articleDTO.isReadAudioAuto; + articleToSend.qrCode = articleDTO.qrCode; widget.onChanged(jsonEncode(articleToSend).toString()); }); }