Add Pdf, puzzle and agenda config + adpat other elements + update service generation

This commit is contained in:
Thomas Fransolet 2023-12-26 15:48:36 +01:00
parent 4b7dac07a8
commit 0c526fe53e
30 changed files with 517 additions and 120 deletions

View File

@ -5,25 +5,24 @@ IconData getSectionIcon(elementType) {
switch(elementType) { switch(elementType) {
case SectionType.Map: case SectionType.Map:
return Icons.location_on; return Icons.location_on;
break;
case SectionType.Slider: case SectionType.Slider:
return Icons.collections; // art_track return Icons.collections; // art_track
break;
case SectionType.Video: case SectionType.Video:
return Icons.ondemand_video_rounded; return Icons.ondemand_video_rounded;
break;
case SectionType.Web: case SectionType.Web:
return Icons.web; return Icons.web;
break;
case SectionType.Menu: case SectionType.Menu:
return Icons.apps_sharp; return Icons.apps_sharp;
break;
case SectionType.Quizz: case SectionType.Quizz:
return Icons.question_answer; return Icons.question_answer;
break;
case SectionType.Article: case SectionType.Article:
return Icons.article_outlined; return Icons.article_outlined;
break; case SectionType.Pdf:
return Icons.picture_as_pdf_outlined;
case SectionType.Puzzle:
return Icons.extension;
case SectionType.Agenda:
return Icons.calendar_month_outlined;
} }
return Icons.menu; return Icons.question_mark;
} }

View File

@ -35,7 +35,7 @@ class MultiSelectContainer extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child: Container( child: Container(
width: size.width *0.2, width: size.width *0.25,
child: MultiSelectChip( child: MultiSelectChip(
values, values,
initialValue, initialValue,

View File

@ -67,7 +67,7 @@ class MultiStringInputContainer extends StatelessWidget {
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initials.firstWhere((element) => element.language == value)))!)!); newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initials.firstWhere((element) => element.language == value)))!)!);
} else { } else {
// New language // New language
newValues.add(TranslationDTO(language: value, value: null)); newValues.add(TranslationDTO(language: value, value: ""));
} }
}); });

View File

@ -101,8 +101,15 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data != null) { if (snapshot.data != null) {
ResourceDTO resourceDTO = snapshot.data!;
return Container( return Container(
decoration: boxDecoration(snapshot.data, appContext), decoration: boxDecoration(snapshot.data, appContext),
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(resourceDTO.type == ResourceType.Image || resourceDTO.type == ResourceType.ImageUrl ? "" : resourceDTO.label!),
),
)
); );
} else { } else {
return Center( return Center(
@ -110,7 +117,7 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
decoration: boxDecoration(null, appContext), decoration: boxDecoration(null, appContext),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text("Aucune image"), child: Text("Aucune ressource"),
) )
) )
); );
@ -158,7 +165,7 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
color: kWhite, color: kWhite,
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
image: resourceDTO != null ? resourceDTO.type != null ? new DecorationImage( image: resourceDTO != null ? resourceDTO.type != null && (resourceDTO.type == ResourceType.Image || resourceDTO.type == ResourceType.ImageUrl)? new DecorationImage(
fit: widget.imageFit, fit: widget.imageFit,
image: new NetworkImage( image: new NetworkImage(
resourceDTO.url!, // TODO handle multiple type of content resourceDTO.url!, // TODO handle multiple type of content

View File

@ -44,7 +44,7 @@ class StringInputContainer extends StatelessWidget {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
width: isUrl ? size.width *0.6 : isSmall ? size.width *0.1 : size.width *0.25, width: isUrl ? size.width *0.6 : isSmall ? size.width *0.1 : size.width *0.25,
child: RoundedInputField( child: RoundedInputField(

View File

@ -83,7 +83,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
height: widget.isTitle ? MediaQuery.of(context).size.height *0.13 : MediaQuery.of(context).size.height *0.35, height: widget.isTitle ? MediaQuery.of(context).size.height *0.13 : MediaQuery.of(context).size.height *0.35,
child: QuillHtmlEditor( child: QuillHtmlEditor(
text: newValues.where((element) => element.language! == currentLanguage.value).first.value!, text: newValues.where((element) => element.language! == currentLanguage.value).first.value!,
//hintText: 'Hint text goes here', hintText: '',
controller: controllerQuill, controller: controllerQuill,
minHeight: widget.isTitle ? 80 : 240, minHeight: widget.isTitle ? 80 : 240,
/*textStyle: _editorTextStyle, /*textStyle: _editorTextStyle,

View File

@ -0,0 +1,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/resource_input_container.dart';
import 'package:manager_api_new/api.dart';
import 'dart:convert';
class AgendaConfig extends StatefulWidget {
final String? color;
final String? label;
final String initialValue;
final ValueChanged<String> onChanged;
const AgendaConfig({
Key? key,
this.color,
this.label,
required this.initialValue,
required this.onChanged,
}) : super(key: key);
@override
_AgendaConfigState createState() => _AgendaConfigState();
}
class _AgendaConfigState extends State<AgendaConfig> {
late AgendaDTO agendaDTO;
@override
void initState() {
AgendaDTO test = AgendaDTO.fromJson(json.decode(widget.initialValue))!;
agendaDTO = test;
super.initState();
}
@override
Widget build(BuildContext context) {
return ResourceInputContainer(
label: "Fichier JSON :",
initialValue: agendaDTO.resourceId == null ? '': agendaDTO.resourceId,
inResourceTypes: [ResourceType.Json],
onChanged: (ResourceDTO resourceDTO) {
agendaDTO.resourceUrl = resourceDTO.url;
agendaDTO.resourceId = resourceDTO.id;
widget.onChanged(jsonEncode(agendaDTO).toString());
}
);
}
}

View File

@ -171,7 +171,7 @@ class _MapConfigState extends State<MapConfig> {
), ),
), ),
Positioned( Positioned(
bottom: 10, top: 10,
right: 10, right: 10,
child: InkWell( child: InkWell(
onTap: () { onTap: () {

View File

@ -47,19 +47,27 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult,
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
StringInputContainer( SizedBox(
label: "Latitude (#.#):", height: 100,
initialValue: geoPointDTO.latitude, child: StringInputContainer(
onChanged: (value) { isSmall: true,
geoPointDTO.latitude = value; label: "Latitude (#.#):",
}, initialValue: geoPointDTO.latitude,
onChanged: (value) {
geoPointDTO.latitude = value;
},
),
), ),
StringInputContainer( SizedBox(
label: "Longitude (#.#):", height: 100,
initialValue: geoPointDTO.longitude, child: StringInputContainer(
onChanged: (value) { isSmall: true,
geoPointDTO.longitude = value; label: "Longitude (#.#):",
}, initialValue: geoPointDTO.longitude,
onChanged: (value) {
geoPointDTO.longitude = value;
},
),
) )
], ],
), ),

View File

@ -38,8 +38,8 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
width: 200, width: 150,
height: 250, height: 200,
decoration: BoxDecoration( decoration: BoxDecoration(
color: kWhite, color: kWhite,
border: Border.all(width: 0.5, color: kSecond), border: Border.all(width: 0.5, color: kSecond),
@ -51,7 +51,7 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
), ),
Positioned( Positioned(
right: 0, right: 0,
bottom: 0, bottom: 15,
child: Row( child: Row(
children: [ children: [
InkWell( InkWell(
@ -70,11 +70,11 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
); );
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(6.0),
child: Icon( child: Icon(
Icons.edit, Icons.edit,
color: kPrimaryColor, color: kPrimaryColor,
size: 25.0, size: 22.0,
), ),
) )
), ),
@ -84,11 +84,11 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
widget.onChanged(widget.listItems); widget.onChanged(widget.listItems);
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(6.0),
child: Icon( child: Icon(
Icons.delete, Icons.delete,
color: kError, color: kError,
size: 25.0, size: 22.0,
), ),
) )
), ),

View File

@ -74,13 +74,14 @@ class _MenuConfigState extends State<MenuConfig> {
child: Stack( child: Stack(
children: [ children: [
Container( Container(
height: size.height *0.25, height: size.height *0.35,
constraints: BoxConstraints(maxHeight: 300, minHeight: 250),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child : ReorderableListView( child : ReorderableListView(
onReorder: _onReorder, onReorder: _onReorder,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: const EdgeInsets.symmetric(vertical: 20.0), padding: const EdgeInsets.symmetric(vertical: 15.0),
children: List.generate( children: List.generate(
menuDTO.sections!.length, menuDTO.sections!.length,
(index) { (index) {
@ -103,7 +104,7 @@ class _MenuConfigState extends State<MenuConfig> {
), ),
), ),
Positioned( Positioned(
bottom: 0, top: 0,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () { onTap: () {

View File

@ -36,12 +36,15 @@ void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
StringInputContainer( SizedBox(
label: "Nom :", height: 100,
initialValue: subSectionDTO.label, child: StringInputContainer(
onChanged: (String name) { label: "Nom :",
subSectionDTO.label = name; initialValue: subSectionDTO.label,
}, onChanged: (String name) {
subSectionDTO.label = name;
},
),
), ),
ResourceInputContainer( ResourceInputContainer(
label: "Image :", label: "Image :",

View File

@ -0,0 +1,49 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/resource_input_container.dart';
import 'package:manager_api_new/api.dart';
import 'dart:convert';
class PDFConfig extends StatefulWidget {
final String? color;
final String? label;
final String initialValue;
final ValueChanged<String> onChanged;
const PDFConfig({
Key? key,
this.color,
this.label,
required this.initialValue,
required this.onChanged,
}) : super(key: key);
@override
_PDFConfigState createState() => _PDFConfigState();
}
class _PDFConfigState extends State<PDFConfig> {
late PdfDTO pdfDTO;
@override
void initState() {
PdfDTO test = PdfDTO.fromJson(json.decode(widget.initialValue))!;
pdfDTO = test;
super.initState();
}
@override
Widget build(BuildContext context) {
return Center(
child: ResourceInputContainer(
label: "Fichier PDF :",
inResourceTypes: [ResourceType.Pdf],
initialValue: pdfDTO.resourceId == null ? '': pdfDTO.resourceId,
onChanged: (ResourceDTO resourceDTO) {
pdfDTO.resourceUrl = resourceDTO.url;
pdfDTO.resourceId = resourceDTO.id;
widget.onChanged(jsonEncode(pdfDTO).toString());
}
),
);
}
}

View File

@ -0,0 +1,105 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/multi_string_input_container.dart';
import 'package:manager_app/Components/resource_input_container.dart';
import 'package:manager_api_new/api.dart';
import 'dart:convert';
import 'package:manager_app/constants.dart';
class PuzzleConfig extends StatefulWidget {
final String? color;
final String? label;
final String initialValue;
final ValueChanged<String> onChanged;
const PuzzleConfig({
Key? key,
this.color,
this.label,
required this.initialValue,
required this.onChanged,
}) : super(key: key);
@override
_PuzzleConfigState createState() => _PuzzleConfigState();
}
class _PuzzleConfigState extends State<PuzzleConfig> {
late PuzzleDTO puzzleDTO;
@override
void initState() {
PuzzleDTO test = PuzzleDTO.fromJson(json.decode(widget.initialValue))!;
if(test.image == null) {
test.image = PuzzleDTOImage();
}
puzzleDTO = test;
super.initState();
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
ResourceInputContainer(
label: "Image du puzzle :",
initialValue: puzzleDTO.image!.resourceId == null ? '': puzzleDTO.image!.resourceId,
onChanged: (ResourceDTO resourceDTO) {
setState(() {
puzzleDTO.image!.resourceId = resourceDTO.id;
puzzleDTO.image!.resourceType = resourceDTO.type;
puzzleDTO.image!.resourceUrl = resourceDTO.url;
print(puzzleDTO.image);
widget.onChanged(jsonEncode(puzzleDTO).toString());
});
}
),
Container(
height: 100,
child: MultiStringInputContainer(
label: "Message départ :",
modalLabel: "Message départ",
fontSize: 20,
isHTML: true,
color: kPrimaryColor,
initialValue: puzzleDTO.messageDebut != null ? puzzleDTO.messageDebut! : [],
onGetResult: (value) {
print("Mess depart test");
print(value);
if (puzzleDTO.messageDebut != value) {
setState(() {
puzzleDTO.messageDebut = value;
widget.onChanged(jsonEncode(puzzleDTO).toString());
});
}
},
maxLines: 1,
isTitle: true
)
),
Container(
height: 100,
child: MultiStringInputContainer(
label: "Message fin :",
modalLabel: "Message fin",
fontSize: 20,
isHTML: true,
color: kPrimaryColor,
initialValue: puzzleDTO.messageFin != null ? puzzleDTO.messageFin! : [],
onGetResult: (value) {
if (puzzleDTO.messageFin != value) {
setState(() {
puzzleDTO.messageFin = value;
widget.onChanged(jsonEncode(puzzleDTO).toString());
});
}
},
maxLines: 1,
isTitle: true
)
),
],
);
}
}

View File

@ -98,8 +98,8 @@ class _SliderConfigState extends State<SliderConfig> {
), ),
), ),
Positioned( Positioned(
bottom: 0, top: 10,
right: 0, right: 10,
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
var result = await showNewOrUpdateContentSlider(null, appContext, context, true, true); var result = await showNewOrUpdateContentSlider(null, appContext, context, true, true);

View File

@ -25,10 +25,13 @@ import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'SubSection/Agenda/agenda_config.dart';
import 'SubSection/Article/article_config.dart'; import 'SubSection/Article/article_config.dart';
import 'SubSection/Article/download_pdf.dart'; import 'SubSection/Article/download_pdf.dart';
import 'SubSection/Map/map_config.dart'; import 'SubSection/Map/map_config.dart';
import 'SubSection/Menu/menu_config.dart'; import 'SubSection/Menu/menu_config.dart';
import 'SubSection/PDF/PDF_config.dart';
import 'SubSection/Puzzle/puzzle_config.dart';
import 'SubSection/Quizz/quizz_config.dart'; import 'SubSection/Quizz/quizz_config.dart';
import 'SubSection/Slider/slider_config.dart'; import 'SubSection/Slider/slider_config.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
@ -223,12 +226,15 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
StringInputContainer( SizedBox(
label: "Identifiant :", height: 100,
initialValue: sectionDTO != null ? sectionDTO.label : "", child: StringInputContainer(
onChanged: (String value) { label: "Identifiant :",
sectionDTO!.label = value; initialValue: sectionDTO != null ? sectionDTO.label : "",
}, onChanged: (String value) {
sectionDTO!.label = value;
},
),
), ),
MultiStringInputContainer( MultiStringInputContainer(
label: "Titre affiché:", label: "Titre affiché:",
@ -426,8 +432,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
return MenuConfig( return MenuConfig(
initialValue: sectionDTO.data!, initialValue: sectionDTO.data!,
onChanged: (String data) { onChanged: (String data) {
//print("Received info in parent");
//print(data);
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
@ -435,8 +439,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
return QuizzConfig( return QuizzConfig(
initialValue: sectionDTO.data!, initialValue: sectionDTO.data!,
onChanged: (String data) { onChanged: (String data) {
//print("Received info in parent - quizz");
//print(data);
sectionDTO.data = data; sectionDTO.data = data;
}, },
); );
@ -444,8 +446,29 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
return ArticleConfig( return ArticleConfig(
initialValue: sectionDTO.data!, initialValue: sectionDTO.data!,
onChanged: (String data) { onChanged: (String data) {
//print("Received info in parent - article"); sectionDTO.data = data;
//print(data); save(false, sectionDTO, appContext);
},
);
case SectionType.Pdf:
return PDFConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
sectionDTO.data = data;
save(false, sectionDTO, appContext);
},
);
case SectionType.Puzzle:
return PuzzleConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
sectionDTO.data = data;
},
);
case SectionType.Agenda:
return AgendaConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
sectionDTO.data = data; sectionDTO.data = data;
save(false, sectionDTO, appContext); save(false, sectionDTO, appContext);
}, },

View File

@ -163,13 +163,17 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
StringInputContainer( SizedBox(
label: "Identifiant :", height: 100,
fontSize: 20, child: StringInputContainer(
initialValue: configurationDTO.label, label: "Identifiant :",
onChanged: (value) { fontSize: 20,
configurationDTO.label = value; fontSizeText: 20,
}, initialValue: configurationDTO.label,
onChanged: (value) {
configurationDTO.label = value;
},
),
), ),
MultiSelectDropdownContainer( MultiSelectDropdownContainer(
label: "Langues :", label: "Langues :",
@ -249,7 +253,25 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
press: () { press: () {
PDFHelper.downloadPDF(sections!); PDFHelper.downloadPDF(sections!);
}, },
) ),
CheckInputContainer(
icon: Icons.date_range,
label: "Date :",
fontSize: 20,
isChecked: configurationDTO.isDate,
onChanged: (value) {
configurationDTO.isDate = value;
},
),
CheckInputContainer(
icon: Icons.watch_later_outlined,
label: "Heure :",
fontSize: 20,
isChecked: configurationDTO.isHour,
onChanged: (value) {
configurationDTO.isHour = value;
},
),
], ],
), ),
Column( Column(
@ -299,13 +321,16 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
} }
}, },
), ),
StringInputContainer( SizedBox(
label: "Ville météo :", height: 100,
fontSize: 20, child: StringInputContainer(
initialValue: configurationDTO.weatherCity, label: "Ville météo :",
onChanged: (value) { fontSize: 20,
configurationDTO.weatherCity = value; initialValue: configurationDTO.weatherCity,
}, onChanged: (value) {
configurationDTO.weatherCity = value;
},
),
), ),
]) ])
], ],

View File

@ -30,12 +30,15 @@ void showNewConfiguration(AppContext appContext, ValueChanged<bool> isImport, Bu
children: [ children: [
Center(child: Text("Nouvelle configuration", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400))), Center(child: Text("Nouvelle configuration", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400))),
Center( Center(
child: StringInputContainer( child: SizedBox(
label: "Nom :", height: 100,
initialValue: configurationDTO.label, child: StringInputContainer(
onChanged: (value) { label: "Nom :",
configurationDTO.label = value; initialValue: configurationDTO.label,
}, onChanged: (value) {
configurationDTO.label = value;
},
),
), ),
), ),
Text("ou"), Text("ou"),

View File

@ -24,33 +24,39 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
), ),
content: SingleChildScrollView( content: SingleChildScrollView(
child: SizedBox( child: SizedBox(
width: size.width*0.3, width: size.width*0.4,
height: size.height*0.3, height: size.height*0.4,
child: Column( child: Container(
children: [ constraints: BoxConstraints(minHeight: 300, minWidth: 300),
Text(isSubSection? "Nouvelle sous section": "Nouvelle section", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)), child: Column(
Column( children: [
children: [ Text(isSubSection? "Nouvelle sous section": "Nouvelle section", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
StringInputContainer( Column(
label: "Nom :", children: [
initialValue: sectionDTO.label, SizedBox(
onChanged: (value) { height: 100,
sectionDTO.label = value; child: StringInputContainer(
}, label: "Nom :",
), initialValue: sectionDTO.label,
MultiSelectContainer( onChanged: (value) {
label: "Type:", sectionDTO.label = value;
initialValue: isMobile ? ["Article"] : ["Map"], },
isMultiple: false, ),
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) { MultiSelectContainer(
var tempOutput = new List<String>.from(value); label: "Type:",
sectionDTO.type = SectionType.fromJson(tempOutput[0]); initialValue: isMobile ? ["Article"] : ["Map"],
}, isMultiple: false,
), 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) {
), var tempOutput = new List<String>.from(value);
], sectionDTO.type = SectionType.fromJson(tempOutput[0]);
},
),
],
),
],
),
), ),
), ),
), ),

View File

@ -124,6 +124,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
left: 10, left: 10,
child: Container( child: Container(
height: size.height*0.1, height: size.height*0.1,
constraints: BoxConstraints(minHeight: 85),
child: StringInputContainer( child: StringInputContainer(
label: "Recherche:", label: "Recherche:",
isSmall: true, isSmall: true,
@ -139,7 +140,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
), ),
), ),
Positioned( Positioned(
bottom: 10, top: 10,
right: 10, right: 10,
child: InkWell( child: InkWell(
onTap: () { onTap: () {

View File

@ -169,7 +169,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
child: Icon( child: Icon(
getResourceIcon(resource.type), getResourceIcon(resource.type),
color: kPrimaryColor, color: kPrimaryColor,
size: 25, size: 15,
), ),
), ),
], ],
@ -178,7 +178,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
return Icon( return Icon(
Icons.close, Icons.close,
color: kTextLightColor, color: kTextLightColor,
size: 80.0, size: 50.0,
); );
} }
} }

View File

@ -1814,6 +1814,10 @@ components:
weatherCity: weatherCity:
type: string type: string
nullable: true nullable: true
isDate:
type: boolean
isHour:
type: boolean
TranslationDTO: TranslationDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -2303,6 +2307,14 @@ components:
$ref: '#/components/schemas/TranslationDTO' $ref: '#/components/schemas/TranslationDTO'
isGood: isGood:
type: boolean type: boolean
resourceId:
type: string
nullable: true
resourceType:
$ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string
nullable: true
order: order:
type: integer type: integer
format: int32 format: int32

View File

@ -25,6 +25,8 @@ Name | Type | Description | Notes
**loaderImageId** | **String** | | [optional] **loaderImageId** | **String** | | [optional]
**loaderImageUrl** | **String** | | [optional] **loaderImageUrl** | **String** | | [optional]
**weatherCity** | **String** | | [optional] **weatherCity** | **String** | | [optional]
**isDate** | **bool** | | [optional]
**isHour** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -25,6 +25,8 @@ Name | Type | Description | Notes
**loaderImageId** | **String** | | [optional] **loaderImageId** | **String** | | [optional]
**loaderImageUrl** | **String** | | [optional] **loaderImageUrl** | **String** | | [optional]
**weatherCity** | **String** | | [optional] **weatherCity** | **String** | | [optional]
**isDate** | **bool** | | [optional]
**isHour** | **bool** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []] **sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []] **resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

@ -10,6 +10,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []] **label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isGood** | **bool** | | [optional] **isGood** | **bool** | | [optional]
**resourceId** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [optional]
**order** | **int** | | [optional] **order** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -30,6 +30,8 @@ class ConfigurationDTO {
this.loaderImageId, this.loaderImageId,
this.loaderImageUrl, this.loaderImageUrl,
this.weatherCity, this.weatherCity,
this.isDate,
this.isHour,
}); });
String? id; String? id;
@ -90,6 +92,22 @@ class ConfigurationDTO {
String? weatherCity; String? weatherCity;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isDate;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isHour;
@override @override
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id && other.id == id &&
@ -108,7 +126,9 @@ class ConfigurationDTO {
other.sectionIds == sectionIds && other.sectionIds == sectionIds &&
other.loaderImageId == loaderImageId && other.loaderImageId == loaderImageId &&
other.loaderImageUrl == loaderImageUrl && other.loaderImageUrl == loaderImageUrl &&
other.weatherCity == weatherCity; other.weatherCity == weatherCity &&
other.isDate == isDate &&
other.isHour == isHour;
@override @override
int get hashCode => int get hashCode =>
@ -129,10 +149,12 @@ class ConfigurationDTO {
(sectionIds == null ? 0 : sectionIds!.hashCode) + (sectionIds == null ? 0 : sectionIds!.hashCode) +
(loaderImageId == null ? 0 : loaderImageId!.hashCode) + (loaderImageId == null ? 0 : loaderImageId!.hashCode) +
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
(weatherCity == null ? 0 : weatherCity!.hashCode); (weatherCity == null ? 0 : weatherCity!.hashCode) +
(isDate == null ? 0 : isDate!.hashCode) +
(isHour == null ? 0 : isHour!.hashCode);
@override @override
String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity]'; String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, isDate=$isDate, isHour=$isHour]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -221,6 +243,16 @@ class ConfigurationDTO {
} else { } else {
json[r'weatherCity'] = null; json[r'weatherCity'] = null;
} }
if (this.isDate != null) {
json[r'isDate'] = this.isDate;
} else {
json[r'isDate'] = null;
}
if (this.isHour != null) {
json[r'isHour'] = this.isHour;
} else {
json[r'isHour'] = null;
}
return json; return json;
} }
@ -264,6 +296,8 @@ class ConfigurationDTO {
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'), loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'), loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
weatherCity: mapValueOfType<String>(json, r'weatherCity'), weatherCity: mapValueOfType<String>(json, r'weatherCity'),
isDate: mapValueOfType<bool>(json, r'isDate'),
isHour: mapValueOfType<bool>(json, r'isHour'),
); );
} }
return null; return null;

View File

@ -30,6 +30,8 @@ class ExportConfigurationDTO {
this.loaderImageId, this.loaderImageId,
this.loaderImageUrl, this.loaderImageUrl,
this.weatherCity, this.weatherCity,
this.isDate,
this.isHour,
this.sections = const [], this.sections = const [],
this.resources = const [], this.resources = const [],
}); });
@ -92,6 +94,22 @@ class ExportConfigurationDTO {
String? weatherCity; String? weatherCity;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isDate;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isHour;
List<SectionDTO>? sections; List<SectionDTO>? sections;
List<ResourceDTO>? resources; List<ResourceDTO>? resources;
@ -115,6 +133,8 @@ class ExportConfigurationDTO {
other.loaderImageId == loaderImageId && other.loaderImageId == loaderImageId &&
other.loaderImageUrl == loaderImageUrl && other.loaderImageUrl == loaderImageUrl &&
other.weatherCity == weatherCity && other.weatherCity == weatherCity &&
other.isDate == isDate &&
other.isHour == isHour &&
other.sections == sections && other.sections == sections &&
other.resources == resources; other.resources == resources;
@ -138,11 +158,13 @@ class ExportConfigurationDTO {
(loaderImageId == null ? 0 : loaderImageId!.hashCode) + (loaderImageId == null ? 0 : loaderImageId!.hashCode) +
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) + (loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
(weatherCity == null ? 0 : weatherCity!.hashCode) + (weatherCity == null ? 0 : weatherCity!.hashCode) +
(isDate == null ? 0 : isDate!.hashCode) +
(isHour == null ? 0 : isHour!.hashCode) +
(sections == null ? 0 : sections!.hashCode) + (sections == null ? 0 : sections!.hashCode) +
(resources == null ? 0 : resources!.hashCode); (resources == null ? 0 : resources!.hashCode);
@override @override
String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, sections=$sections, resources=$resources]'; String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, isDate=$isDate, isHour=$isHour, sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -231,6 +253,16 @@ class ExportConfigurationDTO {
} else { } else {
json[r'weatherCity'] = null; json[r'weatherCity'] = null;
} }
if (this.isDate != null) {
json[r'isDate'] = this.isDate;
} else {
json[r'isDate'] = null;
}
if (this.isHour != null) {
json[r'isHour'] = this.isHour;
} else {
json[r'isHour'] = null;
}
if (this.sections != null) { if (this.sections != null) {
json[r'sections'] = this.sections; json[r'sections'] = this.sections;
} else { } else {
@ -284,6 +316,8 @@ class ExportConfigurationDTO {
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'), loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'), loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
weatherCity: mapValueOfType<String>(json, r'weatherCity'), weatherCity: mapValueOfType<String>(json, r'weatherCity'),
isDate: mapValueOfType<bool>(json, r'isDate'),
isHour: mapValueOfType<bool>(json, r'isHour'),
sections: SectionDTO.listFromJson(json[r'sections']), sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']), resources: ResourceDTO.listFromJson(json[r'resources']),
); );

View File

@ -10,7 +10,7 @@
part of openapi.api; part of openapi.api;
/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl /// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio 5 = PDF 6 = JSON
class ResourceType { class ResourceType {
/// Instantiate a new enum with the provided [value]. /// Instantiate a new enum with the provided [value].
const ResourceType._(this.value); const ResourceType._(this.value);

View File

@ -15,6 +15,9 @@ class ResponseDTO {
ResponseDTO({ ResponseDTO({
this.label = const [], this.label = const [],
this.isGood, this.isGood,
this.resourceId,
this.resourceType,
this.resourceUrl,
this.order, this.order,
}); });
@ -28,6 +31,18 @@ class ResponseDTO {
/// ///
bool? isGood; bool? isGood;
String? resourceId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ResourceType? resourceType;
String? resourceUrl;
/// ///
/// Please note: This property should have been non-nullable! Since the specification file /// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated /// does not include a default value (using the "default:" property), however, the generated
@ -40,6 +55,9 @@ class ResponseDTO {
bool operator ==(Object other) => identical(this, other) || other is ResponseDTO && bool operator ==(Object other) => identical(this, other) || other is ResponseDTO &&
other.label == label && other.label == label &&
other.isGood == isGood && other.isGood == isGood &&
other.resourceId == resourceId &&
other.resourceType == resourceType &&
other.resourceUrl == resourceUrl &&
other.order == order; other.order == order;
@override @override
@ -47,10 +65,13 @@ class ResponseDTO {
// ignore: unnecessary_parenthesis // ignore: unnecessary_parenthesis
(label == null ? 0 : label!.hashCode) + (label == null ? 0 : label!.hashCode) +
(isGood == null ? 0 : isGood!.hashCode) + (isGood == null ? 0 : isGood!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceType == null ? 0 : resourceType!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode) +
(order == null ? 0 : order!.hashCode); (order == null ? 0 : order!.hashCode);
@override @override
String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]'; String toString() => 'ResponseDTO[label=$label, isGood=$isGood, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, order=$order]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -64,6 +85,21 @@ class ResponseDTO {
} else { } else {
json[r'isGood'] = null; json[r'isGood'] = null;
} }
if (this.resourceId != null) {
json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
}
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'resourceType'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
if (this.order != null) { if (this.order != null) {
json[r'order'] = this.order; json[r'order'] = this.order;
} else { } else {
@ -93,6 +129,9 @@ class ResponseDTO {
return ResponseDTO( return ResponseDTO(
label: TranslationDTO.listFromJson(json[r'label']), label: TranslationDTO.listFromJson(json[r'label']),
isGood: mapValueOfType<bool>(json, r'isGood'), isGood: mapValueOfType<bool>(json, r'isGood'),
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
order: mapValueOfType<int>(json, r'order'), order: mapValueOfType<int>(json, r'order'),
); );
} }

View File

@ -76,12 +76,6 @@ class SectionDTO {
/// ///
DateTime? dateCreation; DateTime? dateCreation;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
int? order; int? order;
String? instanceId; String? instanceId;