diff --git a/lib/Helpers/PDFHelper.dart b/lib/Helpers/PDFHelper.dart index be7f03c..a0daca7 100644 --- a/lib/Helpers/PDFHelper.dart +++ b/lib/Helpers/PDFHelper.dart @@ -7,7 +7,7 @@ import 'dart:html' as html; class PDFHelper { static downloadPDF(List sections) async { - var sectionsArticle = sections.where((section) => section.type == SectionType.Article); + var sectionsArticle = sections.where((section) => section.type == SectionType.Article || section.type == SectionType.Quizz); // TODO HERE Support more section types if(sectionsArticle.length > 0) { //final font = await rootBundle.load("fonts/OpenSans-Medium.ttf"); //Uint8List byteData = new File("fonts/OpenSans-Medium.ttf").readAsBytesSync(); diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 5bbd59b..595dcb8 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -101,7 +101,7 @@ class _SectionDetailScreenState extends State { ), ), Text(sectionDTO != null ? sectionDTO.label : "", style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)), - if(sectionDTO.type == SectionType.Article) + if((appContext.getContext() as ManagerAppContext).selectedConfiguration.isMobile) DownloadPDF(sections: [sectionDTO]), ], ), @@ -149,7 +149,7 @@ class _SectionDetailScreenState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - if(sectionDTO.type == SectionType.Article) + if((appContext.getContext() as ManagerAppContext).selectedConfiguration.isMobile) Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -222,7 +222,7 @@ class _SectionDetailScreenState extends State { maxLines: 1, isTitle: true, ), - if(sectionDTO.type != SectionType.Article) + if(!(appContext.getContext() as ManagerAppContext).selectedConfiguration.isMobile) MultiStringContainer( label: "Description affichée:", modalLabel: "Description",