Enable quizz section type for mobile and don't show other when MyVisit is true + update readme

This commit is contained in:
Fransolet Thomas 2023-02-23 17:22:48 +01:00
parent 32fc0593bb
commit 163ce71e38
3 changed files with 13 additions and 4 deletions

View File

@ -31,6 +31,8 @@ Le fichier est dans le projet.
# Publication sur docker # Publication sur docker
Avant de build en docker, il faut build en web => flutter build web
docker build -t flutter-web . docker build -t flutter-web .
Pour tester en local : Pour tester en local :

View File

@ -305,10 +305,17 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
child: FutureBuilder( child: FutureBuilder(
future: getSections(configurationDTO, appContext.getContext().clientAPI), future: getSections(configurationDTO, appContext.getContext().clientAPI),
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done)
sections = new List<SectionDTO>.from(snapshot.data).where((section) => !section.isSubSection).toList(); {
if(configurationDTO.isMobile) {
// Only see Article and Quizz type
sections = new List<SectionDTO>.from(snapshot.data).where((section) => !section.isSubSection && (section.type == SectionType.Article || section.type == SectionType.Quizz)).toList();
} else {
sections = new List<SectionDTO>.from(snapshot.data).where((section) => !section.isSubSection).toList();
}
return bodyGrid(configurationDTO, size, appContext); return bodyGrid(configurationDTO, size, appContext);
} else if (snapshot.connectionState == ConnectionState.none) { }
else if (snapshot.connectionState == ConnectionState.none) {
return Text("No data"); return Text("No data");
} else { } else {
return Center( return Center(

View File

@ -41,7 +41,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
label: "Type :", label: "Type :",
initialValue: isMobile ? ["Article"] : ["Map"], initialValue: isMobile ? ["Article"] : ["Map"],
isMultiple: false, isMultiple: false,
values: isMobile ? section_types.where((sectionType) => sectionType == "Article").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu" && sectionType != "Article").toList(): section_types.where((sectionType) => sectionType != "Article").toList(), // Todo get menu by enum type values: isMobile ? section_types.where((sectionType) => sectionType == "Article" || sectionType == "Quizz").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu" && sectionType != "Article").toList(): section_types.where((sectionType) => sectionType != "Article").toList(), // Todo get menu by enum type
onChanged: (value) { onChanged: (value) {
var tempOutput = new List<String>.from(value); var tempOutput = new List<String>.from(value);
sectionDTO.type = SectionType.fromJson(tempOutput[0]); sectionDTO.type = SectionType.fromJson(tempOutput[0]);