Wip handle new entities and updates for visitNamur

This commit is contained in:
Thomas Fransolet 2023-12-15 17:00:57 +01:00
parent 89d613505a
commit 9d099a201c
81 changed files with 2491 additions and 284 deletions

View File

@ -158,7 +158,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
image: resourceDTO != null ? resourceDTO.type != null ? new DecorationImage(
fit: widget.imageFit,
image: new NetworkImage(
resourceDTO.type! == ResourceType.Image ? (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resourceDTO.id! : resourceDTO.data!,
resourceDTO.url!, // TODO handle multiple type of content
),
) : null : null,
boxShadow: [

View File

@ -28,13 +28,11 @@ class _ResourceTabState extends State<ResourceTab> with SingleTickerProviderStat
@override
void initState() {
tabsToShow.add(new Tab(text: "Image local"));
tabsToShow.add(new Tab(text: "Image en ligne"));
tabsToShow.add(new Tab(text: "Audio local"));
//tabsToShow.add(new Tab(text: "Vidéo en ligne"));
tabsToShow.add(new Tab(text: "Local"));
tabsToShow.add(new Tab(text: "En ligne"));
_tabController = new TabController(length: 3, vsync: this);
_tabController!.addListener(_handleTabSelection);
_tabController = new TabController(length: 2, vsync: this);
//_tabController!.addListener(_handleTabSelection);
super.initState();
}
@ -66,28 +64,28 @@ class _ResourceTabState extends State<ResourceTab> with SingleTickerProviderStat
);
}
void _handleTabSelection() {
/*void _handleTabSelection() {
switch(_tabController!.index) {
case 0:
setState(() {
widget.resourceDTO.data = null;
widget.resourceDTO.url = null;
widget.resourceDTO.type = ResourceType.Image;
});
break;
case 1:
setState(() {
widget.resourceDTO.data = null;
widget.resourceDTO.url = null;
widget.resourceDTO.type = ResourceType.ImageUrl;
});
break;
case 2:
setState(() {
widget.resourceDTO.data = null;
widget.resourceDTO.url = null;
widget.resourceDTO.type = ResourceType.Audio;
});
break;
}
}
}*/
}
getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUploadWeb) {
@ -97,7 +95,7 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
tabsToShow.add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadImageContainer(
child: UploadContentContainer(
onChanged: (List<File>? files) {
onFileUpload(files);
resourceDTO.type = ResourceType.Image;
@ -123,8 +121,8 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
)
);
// Audio local
tabsToShow.add(
// Audio
/*tabsToShow.add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadAudioContainer(
@ -140,8 +138,25 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
)
);
// Video
tabsToShow.add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadContentContainer(
onChanged: (List<File>? files) {
onFileUpload(files);
resourceDTO.type = ResourceType.Video;
},
onChangedWeb: (List<PlatformFile>? files) {
onFileUploadWeb(files);
resourceDTO.type = ResourceType.Video;
},
),
)
);
// Online Video
/*tabsToShow.add(
tabsToShow.add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadOnlineResourceContainer(
@ -151,6 +166,40 @@ getContent(ResourceDTO resourceDTO, Function onFileUpload, Function onFileUpload
},
),
)
);
// PDF
tabsToShow.add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadContentContainer(
onChanged: (List<File>? files) {
onFileUpload(files);
resourceDTO.type = ResourceType.Pdf;
},
onChangedWeb: (List<PlatformFile>? files) {
onFileUploadWeb(files);
resourceDTO.type = ResourceType.Pdf;
},
),
)
);
// JSON
tabsToShow.add(
new Padding(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
child: UploadContentContainer(
onChanged: (List<File>? files) {
onFileUpload(files);
resourceDTO.type = ResourceType.Json;
},
onChangedWeb: (List<PlatformFile>? files) {
onFileUploadWeb(files);
resourceDTO.type = ResourceType.Json;
},
),
)
);*/
return tabsToShow;
}

View File

@ -4,20 +4,20 @@ import 'package:manager_app/constants.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
class UploadImageContainer extends StatefulWidget {
class UploadContentContainer extends StatefulWidget {
final ValueChanged<List<File>?> onChanged;
final ValueChanged<List<PlatformFile>?> onChangedWeb;
const UploadImageContainer({
const UploadContentContainer({
Key? key,
required this.onChanged,
required this.onChangedWeb,
}) : super(key: key);
@override
_UploadImageContainerState createState() => _UploadImageContainerState();
_UploadContentContainerState createState() => _UploadContentContainerState();
}
class _UploadImageContainerState extends State<UploadImageContainer> with SingleTickerProviderStateMixin {
class _UploadContentContainerState extends State<UploadContentContainer> with SingleTickerProviderStateMixin {
var filePath;
File? fileToShow;
String? fileToShowWeb;
@ -48,7 +48,7 @@ class _UploadImageContainerState extends State<UploadImageContainer> with Single
type: FileType.custom,
dialogTitle: 'Sélectionner un fichier',
allowMultiple: true,
allowedExtensions: ['jpg', 'jpeg', 'png'],
allowedExtensions: ['jpg', 'jpeg', 'png', 'mp3', 'mp4', 'pdf', 'json'],
);
if (result != null) {
@ -65,7 +65,7 @@ class _UploadImageContainerState extends State<UploadImageContainer> with Single
type: FileType.custom,
dialogTitle: 'Sélectionner un fichier',
allowMultiple: true,
allowedExtensions: ['jpg', 'jpeg', 'png'],
allowedExtensions: ['jpg', 'jpeg', 'png', 'mp3', 'mp4', 'pdf', 'json'],
);
if (result != null) {
@ -139,6 +139,7 @@ class _UploadImageContainerState extends State<UploadImageContainer> with Single
return null;
} else {
if(fileToShow != null) {
// depends on type..
return Image.file(
fileToShow!,
height: 200,

View File

@ -105,12 +105,14 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
child: Container(
width: size.width *0.35, // TODO GET SIZE
child: RoundedInputField(
hintText: widget.resourceDTO.type == ResourceType.ImageUrl ? "Url de l'image" : "Url de la vidéo",
icon: widget.resourceDTO.type == ResourceType.ImageUrl ? Icons.image : Icons.ondemand_video, // TODO: TBD
hintText: "Url de l'image ou de la vidéo",
//icon: widget.resourceDTO.type == ResourceType.ImageUrl ? Icons.image : Icons.ondemand_video, // TODO: TBD
onChanged: (String text) {
//print("onchanged url");
widget.resourceDTO.data = text;
widget.resourceDTO.url = text; // TODO check if ok
widget.onChanged(widget.resourceDTO);
// TODO check type of resource
widget.resourceDTO.type = ResourceType.ImageUrl; // ou VideoUrl
},
initialValue: ""
),
@ -120,7 +122,7 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
onTap: () {
//print("refresh preview");
setState(() {
urlResourceToShow = widget.resourceDTO.data;
urlResourceToShow = widget.resourceDTO.url;
});
},
child: Center(
@ -134,7 +136,7 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
],
),
),
if(widget.resourceDTO.data != null) showFile()
if(widget.resourceDTO.url != null) showFile()
],
);
}

View File

@ -36,10 +36,10 @@ class _ArticleConfigState extends State<ArticleConfig> {
void initState() {
super.initState();
articleDTO = ArticleDTO.fromJson(json.decode(widget.initialValue))!;
List<ImageDTO> test = new List<ImageDTO>.from(articleDTO.images!);
List<ContentDTO> test = new List<ContentDTO>.from(articleDTO.contents!);
articleDTO.images = test;
articleDTO.images!.sort((a, b) => a.order!.compareTo(b.order!));
articleDTO.contents = test;
articleDTO.contents!.sort((a, b) => a.order!.compareTo(b.order!));
}
@override
@ -53,11 +53,11 @@ class _ArticleConfigState extends State<ArticleConfig> {
if (newIndex > oldIndex) {
newIndex -= 1;
}
final ImageDTO item = articleDTO.images!.removeAt(oldIndex);
articleDTO.images!.insert(newIndex, item);
final ContentDTO item = articleDTO.contents!.removeAt(oldIndex);
articleDTO.contents!.insert(newIndex, item);
var i = 0;
articleDTO.images!.forEach((image) {
articleDTO.contents!.forEach((image) {
image.order = i;
i++;
});
@ -166,21 +166,21 @@ class _ArticleConfigState extends State<ArticleConfig> {
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.symmetric(vertical: 20.0),
children: List.generate(
articleDTO.images!.length,
articleDTO.contents!.length,
(index) {
return ListViewCardImage(
articleDTO.images!,
return ListViewCardContent(
articleDTO.contents!,
index,
Key('$index'),
appContext,
(images) {
setState(() {
List<ImageDTO> test = new List<ImageDTO>.from(images);
articleDTO.images = test;
List<ImageDTO> testToSend = new List<ImageDTO>.from(images);
testToSend = testToSend.where((element) => element.source_ != null).toList();
List<ContentDTO> test = new List<ContentDTO>.from(images);
articleDTO.contents = test;
List<ContentDTO> testToSend = new List<ContentDTO>.from(images);
testToSend = testToSend.where((element) => element.resourceUrl != null).toList();
var articleToSend = new ArticleDTO();
articleToSend.images = testToSend;
articleToSend.contents = testToSend;
articleToSend.audioIds = articleDTO.audioIds;
articleToSend.isContentTop = articleDTO.isContentTop;
articleToSend.content = articleDTO.content;
@ -209,12 +209,12 @@ class _ArticleConfigState extends State<ArticleConfig> {
right: 15,
child: InkWell(
onTap: () async {
var result = await showNewOrUpdateImageSlider(null, appContext, context, true, false);
var result = await showNewOrUpdateContentSlider(null, appContext, context, true, false);
if (result != null)
{
setState(() {
result.order = articleDTO.images!.length;
articleDTO.images!.add(result);
result.order = articleDTO.contents!.length;
articleDTO.contents!.add(result);
widget.onChanged(jsonEncode(articleDTO).toString());
});
}

View File

@ -7,26 +7,26 @@ import 'package:manager_app/constants.dart';
import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart';
class GeoPointImageList extends StatefulWidget {
final List<ImageGeoPoint> images;
final ValueChanged<List<ImageGeoPoint>> onChanged;
const GeoPointImageList({
class GeoPointContentList extends StatefulWidget {
final List<ContentGeoPoint> contents;
final ValueChanged<List<ContentGeoPoint>> onChanged;
const GeoPointContentList({
Key? key,
required this.images,
required this.contents,
required this.onChanged,
}) : super(key: key);
@override
_GeoPointImageListState createState() => _GeoPointImageListState();
_GeoPointContentListState createState() => _GeoPointContentListState();
}
class _GeoPointImageListState extends State<GeoPointImageList> {
late List<ImageGeoPoint> imagesGeo;
class _GeoPointContentListState extends State<GeoPointContentList> {
late List<ContentGeoPoint> contentsGeo;
@override
void initState() {
super.initState();
imagesGeo = new List<ImageGeoPoint>.from(widget.images);
contentsGeo = new List<ContentGeoPoint>.from(widget.contents);
}
void _onReorder(int oldIndex, int newIndex) {
@ -35,10 +35,10 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
if (newIndex > oldIndex) {
newIndex -= 1;
}
final ImageGeoPoint item = imagesGeo.removeAt(oldIndex);
imagesGeo.insert(newIndex, item);
final ContentGeoPoint item = contentsGeo.removeAt(oldIndex);
contentsGeo.insert(newIndex, item);
widget.onChanged(imagesGeo);
widget.onChanged(contentsGeo);
},
);
}
@ -57,18 +57,18 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.symmetric(vertical: 20.0),
children: List.generate(
imagesGeo.length,
contentsGeo.length,
(index) {
return ListViewCardGeoPointImages(
imagesGeo,
return ListViewCardGeoPointContents(
contentsGeo,
index,
Key('$index'),
appContext,
(imagesOutput) {
setState(() {
//List<ImageGeoPoint> test = new List<ImageGeoPoint>.from(imagesOutput);
imagesGeo = imagesOutput;
widget.onChanged(imagesGeo);
contentsGeo = imagesOutput;
widget.onChanged(contentsGeo);
});
}
);
@ -97,12 +97,12 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
);
if (result != null) {
setState(() {
ImageGeoPoint newImage = new ImageGeoPoint(imageResourceId: result.id, imageSource: result.type == ResourceType.ImageUrl ? result.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ result.id);
ContentGeoPoint newImage = new ContentGeoPoint(resourceId: result.id, resourceUrl: result.url);
//print("REULT IMAGES = ");
//print(newImage);
imagesGeo.add(newImage);
contentsGeo.add(newImage);
//print(imagesGeo);
widget.onChanged(imagesGeo);
widget.onChanged(contentsGeo);
});
}
},

View File

@ -4,15 +4,15 @@ import 'package:manager_app/constants.dart';
import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart';
class ListViewCardGeoPointImages extends StatefulWidget {
class ListViewCardGeoPointContents extends StatefulWidget {
final int index;
final Key key;
final List<ImageGeoPoint> listImages;
final List<ContentGeoPoint> listContents;
final AppContext appContext;
final ValueChanged<List<ImageGeoPoint>> onChanged;
final ValueChanged<List<ContentGeoPoint>> onChanged;
ListViewCardGeoPointImages(
this.listImages,
ListViewCardGeoPointContents(
this.listContents,
this.index,
this.key,
this.appContext,
@ -20,10 +20,10 @@ class ListViewCardGeoPointImages extends StatefulWidget {
);
@override
_ListViewCardGeoPointImagesState createState() => _ListViewCardGeoPointImagesState();
_ListViewCardGeoPointContentsState createState() => _ListViewCardGeoPointContentsState();
}
class _ListViewCardGeoPointImagesState extends State<ListViewCardGeoPointImages> {
class _ListViewCardGeoPointContentsState extends State<ListViewCardGeoPointContents> {
@override
Widget build(BuildContext context) {
final appContext = Provider.of<AppContext>(context);
@ -43,7 +43,7 @@ class _ListViewCardGeoPointImagesState extends State<ListViewCardGeoPointImages>
),*/
child: Padding(
padding: const EdgeInsets.only(right: 30.0),
child: getElement(widget.index, widget.listImages[widget.index], size, appContext)
child: getElement(widget.index, widget.listContents[widget.index], size, appContext)
),
),
Positioned(
@ -53,8 +53,8 @@ class _ListViewCardGeoPointImagesState extends State<ListViewCardGeoPointImages>
children: [
InkWell(
onTap: () {
widget.listImages.removeAt(widget.index);
widget.onChanged(widget.listImages);
widget.listContents.removeAt(widget.index);
widget.onChanged(widget.listContents);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
@ -74,15 +74,15 @@ class _ListViewCardGeoPointImagesState extends State<ListViewCardGeoPointImages>
);
}
getElement(int index, ImageGeoPoint imageGeoPoint, Size size, AppContext appContext) {
getElement(int index, ContentGeoPoint contentGeoPoint, Size size, AppContext appContext) {
return Container(
width: double.infinity,
height: double.infinity,
child: Stack(
children: [
Center(
child: Image.network(
imageGeoPoint.imageSource!,
child: Image.network( // TODO support video etc
contentGeoPoint.resourceUrl!,
fit:BoxFit.scaleDown,
loadingBuilder: (BuildContext context, Widget child,
ImageChunkEvent? loadingProgress) {

View File

@ -98,7 +98,7 @@ class _MapConfigState extends State<MapConfig> {
mapDTO.iconResourceId = null;
} else {
mapDTO.iconResourceId = resource.id;
mapDTO.iconSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
mapDTO.iconSource = resource.url;
}
widget.onChanged(jsonEncode(mapDTO).toString());
},

View File

@ -18,7 +18,7 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult,
} else {
geoPointDTO.title = <TranslationDTO>[];
geoPointDTO.description = <TranslationDTO>[];
geoPointDTO.images = <ImageGeoPoint>[];
geoPointDTO.contents = <ContentGeoPoint>[];
ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.selectedConfiguration!.languages!.forEach((element) {
@ -124,10 +124,10 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult,
),
],
),
child: GeoPointImageList(
images: geoPointDTO.images!,
onChanged: (List<ImageGeoPoint> imagesOutput) {
geoPointDTO.images = imagesOutput;
child: GeoPointContentList(
contents: geoPointDTO.contents!,
onChanged: (List<ContentGeoPoint> contentsOutput) {
geoPointDTO.contents = contentsOutput;
},
),
),
@ -152,7 +152,7 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult,
color: kSecond,
press: () {
if (inputGeoPointDTO != null) {
geoPointDTO.images = inputGeoPointDTO.images;
geoPointDTO.contents = inputGeoPointDTO.contents;
}
Navigator.of(context).pop();
},

View File

@ -53,7 +53,7 @@ void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext
subSectionDTO.imageSource = null;
} else {
subSectionDTO.imageId = resource.id;
subSectionDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
subSectionDTO.imageSource = resource.url;
}
},
isSmall: true,

View File

@ -62,10 +62,10 @@ Future<QuestionDTO> showNewOrUpdateQuestionQuizz(QuestionDTO? inputQuestionDTO,
onChanged: (ResourceDTO resource) {
if(resource.id == null) {
questionDTO.resourceId = null;
questionDTO.source_ = null;
questionDTO.resourceUrl = null;
} else {
questionDTO.resourceId = resource.id;
questionDTO.source_ = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
questionDTO.resourceUrl = resource.url;
}
},
isSmall: true

View File

@ -51,10 +51,10 @@ Future<LevelDTO?> showNewOrUpdateScoreQuizz(LevelDTO? inputLevelDTO, AppContext
onChanged: (ResourceDTO resource) {
if(resource.id == null) {
levelDTO.resourceId = null;
levelDTO.source_ = null;
levelDTO.resourceUrl = null;
} else {
levelDTO.resourceId = resource.id;
levelDTO.source_ = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
levelDTO.resourceUrl = resource.url;
}
},
isSmall: true

View File

@ -263,7 +263,7 @@ class _QuizzConfigState extends State<QuizzConfig> {
height: 75,
child: Row(
children: [
if(question.source_ != null) Container(
if(question.resourceUrl != null) Container(
height: 60,
width: 60,
decoration: imageBoxDecoration(question, appContext),
@ -366,10 +366,10 @@ imageBoxDecoration(QuestionDTO questionDTO, appContext) {
shape: BoxShape.rectangle,
border: Border.all(width: 1.5, color: kSecond),
borderRadius: BorderRadius.circular(10.0),
image: questionDTO.source_ != null ? new DecorationImage(
image: questionDTO.resourceUrl != null ? new DecorationImage(
fit: BoxFit.cover,
image: new NetworkImage(
questionDTO.source_!,
questionDTO.resourceUrl!,
),
) : null,
);

View File

@ -6,16 +6,16 @@ import 'package:manager_app/constants.dart';
import 'package:manager_api_new/api.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
class ListViewCardImage extends StatefulWidget {
class ListViewCardContent extends StatefulWidget {
final int index;
final Key key;
final List<ImageDTO> listItems;
final List<ContentDTO> listItems;
final AppContext appContext;
final ValueChanged<List<ImageDTO>> onChanged;
final ValueChanged<List<ContentDTO>> onChanged;
final bool showTitleTranslations;
final bool showDescriptionTranslations;
ListViewCardImage(
ListViewCardContent(
this.listItems,
this.index,
this.key,
@ -29,7 +29,7 @@ class ListViewCardImage extends StatefulWidget {
_ListViewCard createState() => _ListViewCard();
}
class _ListViewCard extends State<ListViewCardImage> {
class _ListViewCard extends State<ListViewCardContent> {
@override
Widget build(BuildContext context) {
return Card(
@ -87,7 +87,7 @@ class _ListViewCard extends State<ListViewCardImage> {
children: [
InkWell(
onTap: () async {
var result = await showNewOrUpdateImageSlider(
var result = await showNewOrUpdateContentSlider(
widget.listItems[widget.index],
widget.appContext,
context,
@ -134,16 +134,16 @@ class _ListViewCard extends State<ListViewCardImage> {
}
}
boxDecoration(ImageDTO imageDTO, appContext) {
boxDecoration(ContentDTO contentDTO, appContext) {
return BoxDecoration(
color: kBackgroundColor,
shape: BoxShape.rectangle,
border: Border.all(width: 1.5, color: kSecond),
borderRadius: BorderRadius.circular(10.0),
image: imageDTO.title != null && imageDTO.source_ != null ? new DecorationImage(
image: contentDTO.title != null && contentDTO.resourceUrl != null ? new DecorationImage(
fit: BoxFit.scaleDown,
image: new NetworkImage(
imageDTO.source_!,
contentDTO.resourceUrl!,
),
) : null,
boxShadow: [

View File

@ -9,14 +9,14 @@ import 'package:manager_app/app_context.dart';
import 'package:manager_app/constants.dart';
import 'package:manager_api_new/api.dart';
Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async {
ImageDTO imageDTO = new ImageDTO();
Future<ContentDTO> showNewOrUpdateContentSlider(ContentDTO? inputContentDTO, AppContext appContext, BuildContext context, bool showTitle, bool showDescription) async {
ContentDTO contentDTO = new ContentDTO();
if (inputImageDTO != null) {
imageDTO = inputImageDTO;
if (inputContentDTO != null) {
contentDTO = inputContentDTO;
} else {
imageDTO.title = <TranslationDTO>[];
imageDTO.description = <TranslationDTO>[];
contentDTO.title = <TranslationDTO>[];
contentDTO.description = <TranslationDTO>[];
ManagerAppContext managerAppContext = appContext.getContext();
managerAppContext.selectedConfiguration!.languages!.forEach((element) {
@ -28,8 +28,8 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext
translationDescriptionDTO.language = element;
translationDescriptionDTO.value = "";
imageDTO.title!.add(translationTitleDTO);
imageDTO.description!.add(translationDescriptionDTO);
contentDTO.title!.add(translationTitleDTO);
contentDTO.description!.add(translationDescriptionDTO);
});
}
@ -53,16 +53,16 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext
Center(
child: ImageInputContainer(
label: "Image :",
initialValue: imageDTO.resourceId,
initialValue: contentDTO.resourceId,
color: kPrimaryColor,
fontSize: 20,
onChanged: (ResourceDTO resource) {
if(resource.id == null) {
imageDTO.resourceId = null;
imageDTO.source_ = null;
contentDTO.resourceId = null;
contentDTO.resourceUrl = null;
} else {
imageDTO.resourceId = resource.id;
imageDTO.source_ = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
contentDTO.resourceId = resource.id;
contentDTO.resourceUrl = resource.url;
}
},
isSmall: true
@ -81,10 +81,10 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext
fontSize: 20,
isHTML: true,
color: kPrimaryColor,
initialValue: imageDTO.title != null ? imageDTO.title! : [],
initialValue: contentDTO.title != null ? contentDTO.title! : [],
onGetResult: (value) {
if (imageDTO.title != value) {
imageDTO.title = value;
if (contentDTO.title != value) {
contentDTO.title = value;
}
},
maxLines: 1,
@ -96,10 +96,10 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext
fontSize: 20,
isHTML: true,
color: kPrimaryColor,
initialValue: imageDTO.description != null ? imageDTO.description! : [],
initialValue: contentDTO.description != null ? contentDTO.description! : [],
onGetResult: (value) {
if (imageDTO.description != value) {
imageDTO.description = value;
if (contentDTO.description != value) {
contentDTO.description = value;
}
},
maxLines: 1,
@ -137,16 +137,16 @@ Future<ImageDTO> showNewOrUpdateImageSlider(ImageDTO? inputImageDTO, AppContext
Align(
alignment: AlignmentDirectional.bottomEnd,
child: Container(
width: inputImageDTO != null ? 220: 150,
width: inputContentDTO != null ? 220: 150,
height: 70,
child: RoundedButton(
text: inputImageDTO != null ? "Sauvegarder" : "Créer",
text: inputContentDTO != null ? "Sauvegarder" : "Créer",
icon: Icons.check,
color: kPrimaryColor,
textColor: kWhite,
press: () {
if (imageDTO.resourceId != null) {
Navigator.pop(dialogContext, imageDTO);
if (contentDTO.resourceId != null) {
Navigator.pop(dialogContext, contentDTO);
}
},
fontSize: 20,

View File

@ -33,9 +33,9 @@ class _SliderConfigState extends State<SliderConfig> {
super.initState();
sliderDTO = SliderDTO.fromJson(json.decode(widget.initialValue))!;
List<ImageDTO> test = new List<ImageDTO>.from(sliderDTO.images!);
sliderDTO.images = test;
sliderDTO.images!.sort((a, b) => a.order!.compareTo(b.order!));
List<ContentDTO> test = new List<ContentDTO>.from(sliderDTO.contents!);
sliderDTO.contents = test;
sliderDTO.contents!.sort((a, b) => a.order!.compareTo(b.order!));
}
@override
@ -49,11 +49,11 @@ class _SliderConfigState extends State<SliderConfig> {
if (newIndex > oldIndex) {
newIndex -= 1;
}
final ImageDTO item = sliderDTO.images!.removeAt(oldIndex);
sliderDTO.images!.insert(newIndex, item);
final ContentDTO item = sliderDTO.contents!.removeAt(oldIndex);
sliderDTO.contents!.insert(newIndex, item);
var i = 0;
sliderDTO.images!.forEach((image) {
sliderDTO.contents!.forEach((image) {
image.order = i;
i++;
});
@ -72,21 +72,21 @@ class _SliderConfigState extends State<SliderConfig> {
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.symmetric(vertical: 20.0),
children: List.generate(
sliderDTO.images!.length,
sliderDTO.contents!.length,
(index) {
return ListViewCardImage(
sliderDTO.images!,
return ListViewCardContent(
sliderDTO.contents!,
index,
Key('$index'),
appContext,
(images) {
setState(() {
List<ImageDTO> test = new List<ImageDTO>.from(images);
sliderDTO.images = test;
List<ImageDTO> testToSend = new List<ImageDTO>.from(images);
testToSend = testToSend.where((element) => element.source_ != null).toList();
List<ContentDTO> test = new List<ContentDTO>.from(images);
sliderDTO.contents = test;
List<ContentDTO> testToSend = new List<ContentDTO>.from(images);
testToSend = testToSend.where((element) => element.resourceUrl != null).toList();
var sliderToSend = new SliderDTO();
sliderToSend.images = testToSend;
sliderToSend.contents = testToSend;
widget.onChanged(jsonEncode(sliderToSend).toString());
});
},
@ -102,12 +102,12 @@ class _SliderConfigState extends State<SliderConfig> {
right: 0,
child: InkWell(
onTap: () async {
var result = await showNewOrUpdateImageSlider(null, appContext, context, true, true);
var result = await showNewOrUpdateContentSlider(null, appContext, context, true, true);
if (result != null)
{
setState(() {
result.order = sliderDTO.images!.length;
sliderDTO.images!.add(result);
result.order = sliderDTO.contents!.length;
sliderDTO.contents!.add(result);
widget.onChanged(jsonEncode(sliderDTO).toString());
});
}

View File

@ -277,7 +277,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
sectionDTO.imageSource = null;
} else {
sectionDTO!.imageId = resource.id;
sectionDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
sectionDTO.imageSource = resource.url;
}
},
),

View File

@ -292,7 +292,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
configurationDTO.imageSource = null;
} else {
configurationDTO.imageId = resource.id;
configurationDTO.imageSource = resource.type == ResourceType.ImageUrl ? resource.data : (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resource.id!;
configurationDTO.imageSource = resource.url;
}
},
),

View File

@ -37,7 +37,7 @@ class _BodyState extends State<Body> {
late MenuSection configurations;
late MenuSection resources;
Menu menu = new Menu(title: "MyMuseum");
Menu menu = new Menu(title: "MyInfoMate");
@override
void initState() {
@ -217,7 +217,11 @@ class _BodyState extends State<Body> {
resourceTypes: [
ResourceType.Audio,
ResourceType.Image,
ResourceType.ImageUrl
ResourceType.ImageUrl,
ResourceType.Video,
ResourceType.VideoUrl,
ResourceType.Pdf,
ResourceType.Json
]
)
);

View File

@ -31,7 +31,7 @@ class _MainScreenState extends State<MainScreen> {
);
} else {
return Scaffold(
appBar: AppBar(title: Text("MyMuseum", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)),
appBar: AppBar(title: Text("MyInfoMate", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)),
drawer: Drawer(
child: getMenu()
),
@ -46,7 +46,7 @@ class _MainScreenState extends State<MainScreen> {
MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1); // TODO Visites pour Fort St Héribert
MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2);
Menu menu = new Menu(title: "MyMuseum");
Menu menu = new Menu(title: "MyInfoMate");
return ListView(
// Important: Remove any padding from the ListView.

View File

@ -42,7 +42,7 @@ dynamic showNewResource(AppContext appContext, BuildContext context) async {
],
),
Container(
width: size.width *0.5,
width: size.width *0.85,
height: size.height *0.5,
child: ResourceTab(
resourceDTO: resourceDetailDTO,
@ -91,13 +91,13 @@ dynamic showNewResource(AppContext appContext, BuildContext context) async {
press: () {
if (resourceDetailDTO.label != null && resourceDetailDTO.label!.trim() != '') {
if(kIsWeb) {
if(resourceDetailDTO.data != null || filesToSendWeb != null) {
if(resourceDetailDTO.url != null || filesToSendWeb != null) { // TODO clarify resourceDetailDTO.data != null
Navigator.pop(context, [resourceDetailDTO, filesToSend, filesToSendWeb]);
} else {
showNotification(Colors.orange, kWhite, 'Aucun fichier n\'a été chargé', context, null);
}
} else {
if (resourceDetailDTO.data != null || filesToSendWeb!.length > 0 || filesToSend!.length > 0) {
if (resourceDetailDTO.url != null || filesToSendWeb!.length > 0 || filesToSend!.length > 0) { // TODO clarify resourceDetailDTO.data != null
Navigator.pop(context, [resourceDetailDTO, filesToSend, filesToSendWeb]);
} else {
showNotification(Colors.orange, kWhite, 'Aucun fichier n\'a été chargé', context, null);

View File

@ -190,16 +190,18 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
}
}
boxDecoration(dynamic resourceDetailDTO, appContext) {
boxDecoration(ResourceDTO resourceDetailDTO, appContext) {
print("boxDecorationboxDecorationboxDecorationboxDecoration");
print(resourceDetailDTO);
return BoxDecoration(
color: resourceDetailDTO.id == null ? kSecond : kBackgroundColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0),
image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.Image || resourceDetailDTO.data != null && resourceDetailDTO.type == ResourceType.ImageUrl)? new DecorationImage(
image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.Image || resourceDetailDTO.url != null && resourceDetailDTO.type == ResourceType.ImageUrl)? new DecorationImage(
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop),
image: new NetworkImage(
resourceDetailDTO.type == ResourceType.Image ? (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.apiClient.basePath+"/api/Resource/"+ resourceDetailDTO.id : resourceDetailDTO.data,
resourceDetailDTO.url!,
),
) : null,
boxShadow: [

View File

@ -121,8 +121,72 @@ Future<List<ResourceDTO>?> getResources(Function? onGetResult, bool isImage, App
return resources;
}
Future<ResourceDTO?> create(ResourceDTO resourceDTO, List<File>? files, List<PlatformFile>? filesWeb, AppContext appContext, context) async {
switch(resourceDTO.type) {
Future<List<ResourceDTO?>?> create(ResourceDTO resourceDTO, List<File>? files, List<PlatformFile>? filesWeb, AppContext appContext, context) async {
List<ResourceDTO?> createdResources = [];
print("Coucou create");
print(resourceDTO);
ManagerAppContext managerAppContext = appContext.getContext();
int index = 0;
// TODO handle online resource
for (PlatformFile platformFile in filesWeb!) {
print("Coucou platformFile");
print(platformFile);
print(platformFile.name);
print(platformFile.extension);
ResourceDTO resourceDTO = new ResourceDTO(label: platformFile.name);
switch(platformFile.extension) {
case 'jpg':
case 'jpeg':
case 'png':
resourceDTO.type = ResourceType.Image;
break;
case 'mp3':
resourceDTO.type = ResourceType.Audio;
break;
case 'mp4':
resourceDTO.type = ResourceType.Video;
break;
case 'pdf':
resourceDTO.type = ResourceType.Pdf;
break;
case 'json':
resourceDTO.type = ResourceType.Json;
break;
}
resourceDTO.instanceId = managerAppContext.instanceId;
try {
print("Trying to create resource");
resourceDTO.dateCreation = DateTime.now();
ResourceDTO? newResource = await managerAppContext.clientAPI!.resourceApi!.resourceCreate(resourceDTO);
print("created resource");
print(newResource);
if(newResource != null && resourceDTO.type != null) {
FirebaseStorage storage = FirebaseStorage.instance;
Reference ref = storage.ref().child('pictures/${appContext.getContext().instanceId}/${Path.basename(newResource.id!.toString())}.${platformFile.extension}');
UploadTask uploadTask = ref.putData(platformFile.bytes!);
uploadTask.then((res) {
res.ref.getDownloadURL().then((urlImage) {
showNotification(Colors.green, kWhite, 'La ressource a été créée avec succès', context, null);
newResource.url = urlImage;
(appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.resourceUpdate(newResource);
createdResources.add(newResource);
index++;
if(index == filesWeb.length) {
return createdResources;
}
});
});
}
} catch(e) {
print("ERROR creating resource");
print(e);
}
}
return null;
/*switch(resourceDTO.type) {
case ResourceType.Audio:
case ResourceType.Image:
case ResourceType.Video:
@ -162,8 +226,6 @@ Future<ResourceDTO?> create(ResourceDTO resourceDTO, List<File>? files, List<Pla
await res.stream.bytesToString();
if (res.statusCode == 200) {
// TODO just create resource ref with download url from followed
try {
for (PlatformFile platformFile in filesWeb!) {
@ -178,7 +240,7 @@ Future<ResourceDTO?> create(ResourceDTO resourceDTO, List<File>? files, List<Pla
uploadTask.then((res) {
res.ref.getDownloadURL().then((urlImage) {
showNotification(Colors.green, kWhite, 'La ressource a été créée avec succès', context, null);
newResource.data = urlImage;
newResource.url = urlImage;
(appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.resourceUpdate(newResource);
return newResource;
});
@ -186,13 +248,10 @@ Future<ResourceDTO?> create(ResourceDTO resourceDTO, List<File>? files, List<Pla
}
showNotification(Colors.orange, kWhite, 'Une erreur est survenue lors de la création de la ressource', context, null);
return null;
}
} catch (e) {
print('Error uploading file: $e');
}
return null;
} else {
showNotification(kPrimaryColor, kWhite, 'Erreur, attention, la taille de la ressource doit être inférieure à 1.5Mb', context, null);
@ -200,9 +259,9 @@ Future<ResourceDTO?> create(ResourceDTO resourceDTO, List<File>? files, List<Pla
break;
case ResourceType.ImageUrl:
case ResourceType.VideoUrl:
if (resourceDTO.data != null) {
if (resourceDTO.url != null) {
// test if Correct url
bool _validURL = Uri.parse(resourceDTO.data!).isAbsolute;
bool _validURL = Uri.parse(resourceDTO.url!).isAbsolute;
if(_validURL) {
resourceDTO.instanceId = (appContext.getContext() as ManagerAppContext).instanceId;
ResourceDTO? newResource = await (appContext.getContext() as ManagerAppContext).clientAPI!.resourceApi!.resourceCreate(resourceDTO);
@ -216,5 +275,5 @@ Future<ResourceDTO?> create(ResourceDTO resourceDTO, List<File>? files, List<Pla
showNotification(Colors.orange, kWhite, 'Veuillez remplir le champ URL', context, null);
}
break;
}
}*/
}

View File

@ -31,11 +31,11 @@ class LoginScreen extends StatefulWidget {
class _LoginScreenState extends State<LoginScreen> {
String email = ""; // DEV "test@email.be"
String password = ""; // DEV = "kljqsdkljqsd"
String? host = "https://api.mymuseum.be"; // DEV = "http://192.168.31.96" // http://localhost:5000 // https://api.mymuseum.be // myCore http://192.168.31.140:8089
String? host = "http://localhost:5000"; // "https://api.myinfomate.be" // "https://api.mymuseum.be" // DEV = "http://192.168.31.96" // http://localhost:5000 // https://api.mymuseum.be // myCore http://192.168.31.140:8089
Client? clientAPI;
bool isLoading = false;
bool isRememberMe = false;
String pageTitle = "MyMuseum";
String pageTitle = "MyInfoMate";
String? token;
String? instanceId;
int? pinCode;
@ -174,7 +174,7 @@ class _LoginScreenState extends State<LoginScreen> {
@override
void initState() {
//this.isRememberMe = widget.session.rememberMe;
this.host = "https://api.mymuseum.be"; // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be"
this.host = "http://localhost:5000"; // "https://api.myinfomate.be"// "https://api.mymuseum.be" // "http://localhost:5000" //widget.session.host; // MDLF "http://192.168.1.19:8089" // "https://api.mymuseum.be"
//this.email = "test@email.be"; //widget.session.email;
//this.password = "kljqsdkljqsd"; //widget.session.password;
@ -205,7 +205,7 @@ class _LoginScreenState extends State<LoginScreen> {
var subdomain = urlParts[0].replaceAll('https://', '');
switch(subdomain) {
case "manager":
this.pageTitle = "MyMuseum";
this.pageTitle = "MyInfoMate";
break;
case "fortsaintheribert":
this.pageTitle = "Fort de Saint Héribert";

View File

@ -5,7 +5,7 @@ info:
description: API Manager Service
version: Version Alpha
servers:
- url: https://api.mymuseum.be
- url: http://localhost:5000
paths:
/api/Configuration:
get:
@ -1463,6 +1463,48 @@ paths:
$ref: '#/components/schemas/ArticleDTO'
security:
- bearer: []
/api/Section/PdfDTO:
get:
tags:
- Section
operationId: Section_GetPdfDTO
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/PdfDTO'
security:
- bearer: []
/api/Section/PuzzleDTO:
get:
tags:
- Section
operationId: Section_GetPuzzleDTO
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/PuzzleDTO'
security:
- bearer: []
/api/Section/AgendaDTO:
get:
tags:
- Section
operationId: Section_GetAgendaDTO
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/AgendaDTO'
security:
- bearer: []
/api/User:
get:
tags:
@ -1866,6 +1908,9 @@ components:
4 = Menu
5 = Quizz
6 = Article
7 = PDF
8 = Puzzle
9 = Agenda
x-enumNames:
- Map
- Slider
@ -1874,6 +1919,9 @@ components:
- Menu
- Quizz
- Article
- PDF
- Puzzle
- Agenda
enum:
- 0
- 1
@ -1882,6 +1930,9 @@ components:
- 4
- 5
- 6
- 7
- 8
- 9
ResourceDTO:
type: object
additionalProperties: false
@ -1894,7 +1945,7 @@ components:
label:
type: string
nullable: true
data:
url:
type: string
nullable: true
dateCreation:
@ -1911,18 +1962,24 @@ components:
2 = ImageUrl
3 = VideoUrl
4 = Audio
5 = PDF
6 = JSON
x-enumNames:
- Image
- Video
- ImageUrl
- VideoUrl
- Audio
- PDF
- JSON
enum:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
DeviceDTO:
type: object
additionalProperties: false
@ -2031,6 +2088,11 @@ components:
iconSource:
type: string
nullable: true
categories:
type: array
nullable: true
items:
$ref: '#/components/schemas/CategorieDTO'
MapTypeApp:
type: integer
description: |-
@ -2068,37 +2130,56 @@ components:
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
images:
contents:
type: array
nullable: true
items:
$ref: '#/components/schemas/ImageGeoPoint'
$ref: '#/components/schemas/ContentGeoPoint'
categorie:
nullable: true
oneOf:
- $ref: '#/components/schemas/CategorieDTO'
latitude:
type: string
nullable: true
longitude:
type: string
nullable: true
ImageGeoPoint:
ContentGeoPoint:
type: object
additionalProperties: false
properties:
imageResourceId:
resourceId:
type: string
nullable: true
imageSource:
resourceType:
$ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string
nullable: true
latitude:
type: string
nullable: true
CategorieDTO:
type: object
additionalProperties: false
properties:
name:
type: string
nullable: true
icon:
type: string
nullable: true
SliderDTO:
type: object
additionalProperties: false
properties:
images:
contents:
type: array
nullable: true
items:
$ref: '#/components/schemas/ImageDTO'
ImageDTO:
$ref: '#/components/schemas/ContentDTO'
ContentDTO:
type: object
additionalProperties: false
properties:
@ -2115,12 +2196,14 @@ components:
resourceId:
type: string
nullable: true
source:
resourceUrl:
type: string
nullable: true
order:
type: integer
format: int32
resourceType:
$ref: '#/components/schemas/ResourceType'
VideoDTO:
type: object
additionalProperties: false
@ -2194,7 +2277,9 @@ components:
resourceId:
type: string
nullable: true
source:
resourceType:
$ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string
nullable: true
order:
@ -2226,7 +2311,9 @@ components:
resourceId:
type: string
nullable: true
source:
resourceType:
$ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string
nullable: true
ArticleDTO:
@ -2247,11 +2334,49 @@ components:
$ref: '#/components/schemas/TranslationDTO'
isReadAudioAuto:
type: boolean
images:
contents:
type: array
nullable: true
items:
$ref: '#/components/schemas/ImageDTO'
$ref: '#/components/schemas/ContentDTO'
PdfDTO:
type: object
additionalProperties: false
properties:
resourceId:
type: string
nullable: true
resourceUrl:
type: string
nullable: true
PuzzleDTO:
type: object
additionalProperties: false
properties:
messageDebut:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
messageFin:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
image:
nullable: true
oneOf:
- $ref: '#/components/schemas/ContentDTO'
AgendaDTO:
type: object
additionalProperties: false
properties:
resourceId:
type: string
nullable: true
resourceUrl:
type: string
nullable: true
User:
type: object
additionalProperties: false

View File

@ -20,9 +20,13 @@ const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Qu
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"];
List<ResourceTypeModel> resource_types = [
ResourceTypeModel(label: "image", type: ResourceType.Image),
ResourceTypeModel(label: "image url", type: ResourceType.ImageUrl),
ResourceTypeModel(label: "audio", type: ResourceType.Audio)
ResourceTypeModel(label: "Image", type: ResourceType.Image),
ResourceTypeModel(label: "Image url", type: ResourceType.ImageUrl),
ResourceTypeModel(label: "Vidéo", type: ResourceType.Video),
ResourceTypeModel(label: "Vidéo url", type: ResourceType.VideoUrl),
ResourceTypeModel(label: "Audio", type: ResourceType.Audio),
ResourceTypeModel(label: "PDF", type: ResourceType.Pdf),
ResourceTypeModel(label: "JSON", type: ResourceType.Json)
]; // "video url" , "video", {"label": "image"}, "image url", "audio"
/*

View File

@ -2,10 +2,14 @@
.travis.yml
README.md
analysis_options.yaml
doc/AgendaDTO.md
doc/ArticleDTO.md
doc/AuthenticationApi.md
doc/CategorieDTO.md
doc/ConfigurationApi.md
doc/ConfigurationDTO.md
doc/ContentDTO.md
doc/ContentGeoPoint.md
doc/DeviceApi.md
doc/DeviceDTO.md
doc/DeviceDetailDTO.md
@ -13,8 +17,7 @@ doc/DeviceDetailDTOAllOf.md
doc/ExportConfigurationDTO.md
doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md
doc/ImageDTO.md
doc/ImageGeoPoint.md
doc/GeoPointDTOCategorie.md
doc/Instance.md
doc/InstanceApi.md
doc/InstanceDTO.md
@ -23,7 +26,10 @@ doc/LoginDTO.md
doc/MapDTO.md
doc/MapTypeApp.md
doc/MenuDTO.md
doc/PdfDTO.md
doc/PlayerMessageDTO.md
doc/PuzzleDTO.md
doc/PuzzleDTOImage.md
doc/QuestionDTO.md
doc/QuizzDTO.md
doc/QuizzDTOBadLevel.md
@ -59,16 +65,19 @@ lib/auth/authentication.dart
lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart
lib/model/agenda_dto.dart
lib/model/article_dto.dart
lib/model/categorie_dto.dart
lib/model/configuration_dto.dart
lib/model/content_dto.dart
lib/model/content_geo_point.dart
lib/model/device_detail_dto.dart
lib/model/device_detail_dto_all_of.dart
lib/model/device_dto.dart
lib/model/export_configuration_dto.dart
lib/model/export_configuration_dto_all_of.dart
lib/model/geo_point_dto.dart
lib/model/image_dto.dart
lib/model/image_geo_point.dart
lib/model/geo_point_dto_categorie.dart
lib/model/instance.dart
lib/model/instance_dto.dart
lib/model/level_dto.dart
@ -76,7 +85,10 @@ lib/model/login_dto.dart
lib/model/map_dto.dart
lib/model/map_type_app.dart
lib/model/menu_dto.dart
lib/model/pdf_dto.dart
lib/model/player_message_dto.dart
lib/model/puzzle_dto.dart
lib/model/puzzle_dto_image.dart
lib/model/question_dto.dart
lib/model/quizz_dto.dart
lib/model/quizz_dto_bad_level.dart

View File

@ -60,7 +60,7 @@ try {
## Documentation for API Endpoints
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
@ -97,6 +97,7 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionDelete**](doc\/SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*SectionApi* | [**sectionGetAgendaDTO**](doc\/SectionApi.md#sectiongetagendadto) | **GET** /api/Section/AgendaDTO |
*SectionApi* | [**sectionGetAllBeaconsForInstance**](doc\/SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
@ -104,6 +105,8 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
*SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO |
*SectionApi* | [**sectionGetPdfDTO**](doc\/SectionApi.md#sectiongetpdfdto) | **GET** /api/Section/PdfDTO |
*SectionApi* | [**sectionGetPuzzleDTO**](doc\/SectionApi.md#sectiongetpuzzledto) | **GET** /api/Section/PuzzleDTO |
*SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
@ -120,16 +123,19 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [AgendaDTO](doc\/AgendaDTO.md)
- [ArticleDTO](doc\/ArticleDTO.md)
- [CategorieDTO](doc\/CategorieDTO.md)
- [ConfigurationDTO](doc\/ConfigurationDTO.md)
- [ContentDTO](doc\/ContentDTO.md)
- [ContentGeoPoint](doc\/ContentGeoPoint.md)
- [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
- [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md)
- [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md)
- [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [GeoPointDTOCategorie](doc\/GeoPointDTOCategorie.md)
- [Instance](doc\/Instance.md)
- [InstanceDTO](doc\/InstanceDTO.md)
- [LevelDTO](doc\/LevelDTO.md)
@ -137,7 +143,10 @@ Class | Method | HTTP request | Description
- [MapDTO](doc\/MapDTO.md)
- [MapTypeApp](doc\/MapTypeApp.md)
- [MenuDTO](doc\/MenuDTO.md)
- [PdfDTO](doc\/PdfDTO.md)
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
- [PuzzleDTO](doc\/PuzzleDTO.md)
- [PuzzleDTOImage](doc\/PuzzleDTOImage.md)
- [QuestionDTO](doc\/QuestionDTO.md)
- [QuizzDTO](doc\/QuizzDTO.md)
- [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md)

View File

@ -0,0 +1,16 @@
# manager_api_new.model.AgendaDTO
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resourceId** | **String** | | [optional]
**resourceUrl** | **String** | | [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)

View File

@ -12,7 +12,7 @@ Name | Type | Description | Notes
**isContentTop** | **bool** | | [optional]
**audioIds** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isReadAudioAuto** | **bool** | | [optional]
**images** | [**List<ImageDTO>**](ImageDTO.md) | | [optional] [default to const []]
**contents** | [**List<ContentDTO>**](ContentDTO.md) | | [optional] [default to const []]
[[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

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -0,0 +1,16 @@
# manager_api_new.model.CategorieDTO
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]
**icon** | **String** | | [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)

View File

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -0,0 +1,20 @@
# manager_api_new.model.ContentDTO
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**resourceUrl** | **String** | | [optional]
**order** | **int** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [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)

View File

@ -0,0 +1,18 @@
# manager_api_new.model.ContentGeoPoint
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resourceId** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [optional]
**latitude** | **String** | | [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)

View File

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -11,7 +11,8 @@ Name | Type | Description | Notes
**id** | **int** | | [optional]
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**images** | [**List<ImageGeoPoint>**](ImageGeoPoint.md) | | [optional] [default to const []]
**contents** | [**List<ContentGeoPoint>**](ContentGeoPoint.md) | | [optional] [default to const []]
**categorie** | [**GeoPointDTOCategorie**](GeoPointDTOCategorie.md) | | [optional]
**latitude** | **String** | | [optional]
**longitude** | **String** | | [optional]

View File

@ -0,0 +1,16 @@
# manager_api_new.model.GeoPointDTOCategorie
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]
**icon** | **String** | | [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)

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**resourceId** | **String** | | [optional]
**source_** | **String** | | [optional]
**order** | **int** | | [optional]
**type** | [**ResourceType**](ResourceType.md) | | [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)

View File

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -10,7 +10,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**source_** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [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)

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**points** | [**List<GeoPointDTO>**](GeoPointDTO.md) | | [optional] [default to const []]
**iconResourceId** | **String** | | [optional]
**iconSource** | **String** | | [optional]
**categories** | [**List<CategorieDTO>**](CategorieDTO.md) | | [optional] [default to const []]
[[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

@ -0,0 +1,16 @@
# manager_api_new.model.PdfDTO
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**resourceId** | **String** | | [optional]
**resourceUrl** | **String** | | [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)

View File

@ -0,0 +1,17 @@
# manager_api_new.model.PuzzleDTO
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**messageDebut** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**messageFin** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**image** | [**PuzzleDTOImage**](PuzzleDTOImage.md) | | [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)

View File

@ -0,0 +1,20 @@
# manager_api_new.model.PuzzleDTOImage
## Load the model package
```dart
import 'package:manager_api_new/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**resourceUrl** | **String** | | [optional]
**order** | **int** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [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)

View File

@ -11,7 +11,8 @@ Name | Type | Description | Notes
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**responses** | [**List<ResponseDTO>**](ResponseDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**source_** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [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)

View File

@ -10,7 +10,8 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**source_** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [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)

View File

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -11,7 +11,7 @@ Name | Type | Description | Notes
**id** | **String** | | [optional]
**type** | [**ResourceType**](ResourceType.md) | | [optional]
**label** | **String** | | [optional]
**data** | **String** | | [optional]
**url** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]

View File

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------
@ -13,6 +13,7 @@ Method | HTTP request | Description
[**sectionDelete**](SectionApi.md#sectiondelete) | **DELETE** /api/Section/{id} |
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
[**sectionGetAgendaDTO**](SectionApi.md#sectiongetagendadto) | **GET** /api/Section/AgendaDTO |
[**sectionGetAllBeaconsForInstance**](SectionApi.md#sectiongetallbeaconsforinstance) | **GET** /api/Section/beacons/{instanceId} |
[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
@ -20,6 +21,8 @@ Method | HTTP request | Description
[**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
[**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
[**sectionGetMenuDTO**](SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO |
[**sectionGetPdfDTO**](SectionApi.md#sectiongetpdfdto) | **GET** /api/Section/PdfDTO |
[**sectionGetPuzzleDTO**](SectionApi.md#sectiongetpuzzledto) | **GET** /api/Section/PuzzleDTO |
[**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
[**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
[**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
@ -201,6 +204,45 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetAgendaDTO**
> AgendaDTO sectionGetAgendaDTO()
### Example
```dart
import 'package:manager_api_new/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi();
try {
final result = api_instance.sectionGetAgendaDTO();
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetAgendaDTO: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**AgendaDTO**](AgendaDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetAllBeaconsForInstance**
> List<SectionDTO> sectionGetAllBeaconsForInstance(instanceId)
@ -490,6 +532,84 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetPdfDTO**
> PdfDTO sectionGetPdfDTO()
### Example
```dart
import 'package:manager_api_new/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi();
try {
final result = api_instance.sectionGetPdfDTO();
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetPdfDTO: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**PdfDTO**](PdfDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetPuzzleDTO**
> PuzzleDTO sectionGetPuzzleDTO()
### Example
```dart
import 'package:manager_api_new/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi();
try {
final result = api_instance.sectionGetPuzzleDTO();
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetPuzzleDTO: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**PuzzleDTO**](PuzzleDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetQuizzDTO**
> QuizzDTO sectionGetQuizzDTO()

View File

@ -8,7 +8,7 @@ import 'package:manager_api_new/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**images** | [**List<ImageDTO>**](ImageDTO.md) | | [optional] [default to const []]
**contents** | [**List<ContentDTO>**](ContentDTO.md) | | [optional] [default to const []]
[[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

@ -5,7 +5,7 @@
import 'package:manager_api_new/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
All URIs are relative to *http://localhost:5000*
Method | HTTP request | Description
------------- | ------------- | -------------

View File

@ -35,16 +35,19 @@ part 'api/resource_api.dart';
part 'api/section_api.dart';
part 'api/user_api.dart';
part 'model/agenda_dto.dart';
part 'model/article_dto.dart';
part 'model/categorie_dto.dart';
part 'model/configuration_dto.dart';
part 'model/content_dto.dart';
part 'model/content_geo_point.dart';
part 'model/device_dto.dart';
part 'model/device_detail_dto.dart';
part 'model/device_detail_dto_all_of.dart';
part 'model/export_configuration_dto.dart';
part 'model/export_configuration_dto_all_of.dart';
part 'model/geo_point_dto.dart';
part 'model/image_dto.dart';
part 'model/image_geo_point.dart';
part 'model/geo_point_dto_categorie.dart';
part 'model/instance.dart';
part 'model/instance_dto.dart';
part 'model/level_dto.dart';
@ -52,7 +55,10 @@ part 'model/login_dto.dart';
part 'model/map_dto.dart';
part 'model/map_type_app.dart';
part 'model/menu_dto.dart';
part 'model/pdf_dto.dart';
part 'model/player_message_dto.dart';
part 'model/puzzle_dto.dart';
part 'model/puzzle_dto_image.dart';
part 'model/question_dto.dart';
part 'model/quizz_dto.dart';
part 'model/quizz_dto_bad_level.dart';

View File

@ -213,6 +213,47 @@ class SectionApi {
return null;
}
/// Performs an HTTP 'GET /api/Section/AgendaDTO' operation and returns the [Response].
Future<Response> sectionGetAgendaDTOWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/api/Section/AgendaDTO';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<AgendaDTO?> sectionGetAgendaDTO() async {
final response = await sectionGetAgendaDTOWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AgendaDTO',) as AgendaDTO;
}
return null;
}
/// Performs an HTTP 'GET /api/Section/beacons/{instanceId}' operation and returns the [Response].
/// Parameters:
///
@ -537,6 +578,88 @@ class SectionApi {
return null;
}
/// Performs an HTTP 'GET /api/Section/PdfDTO' operation and returns the [Response].
Future<Response> sectionGetPdfDTOWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/api/Section/PdfDTO';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<PdfDTO?> sectionGetPdfDTO() async {
final response = await sectionGetPdfDTOWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PdfDTO',) as PdfDTO;
}
return null;
}
/// Performs an HTTP 'GET /api/Section/PuzzleDTO' operation and returns the [Response].
Future<Response> sectionGetPuzzleDTOWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/api/Section/PuzzleDTO';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<PuzzleDTO?> sectionGetPuzzleDTO() async {
final response = await sectionGetPuzzleDTOWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PuzzleDTO',) as PuzzleDTO;
}
return null;
}
/// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response].
Future<Response> sectionGetQuizzDTOWithHttpInfo() async {
// ignore: prefer_const_declarations

View File

@ -11,7 +11,7 @@
part of openapi.api;
class ApiClient {
ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication,});
ApiClient({this.basePath = 'http://localhost:5000', this.authentication,});
final String basePath;
final Authentication? authentication;
@ -181,10 +181,18 @@ class ApiClient {
return valueString == 'true' || valueString == '1';
case 'DateTime':
return value is DateTime ? value : DateTime.tryParse(value);
case 'AgendaDTO':
return AgendaDTO.fromJson(value);
case 'ArticleDTO':
return ArticleDTO.fromJson(value);
case 'CategorieDTO':
return CategorieDTO.fromJson(value);
case 'ConfigurationDTO':
return ConfigurationDTO.fromJson(value);
case 'ContentDTO':
return ContentDTO.fromJson(value);
case 'ContentGeoPoint':
return ContentGeoPoint.fromJson(value);
case 'DeviceDTO':
return DeviceDTO.fromJson(value);
case 'DeviceDetailDTO':
@ -197,10 +205,8 @@ class ApiClient {
return ExportConfigurationDTOAllOf.fromJson(value);
case 'GeoPointDTO':
return GeoPointDTO.fromJson(value);
case 'ImageDTO':
return ImageDTO.fromJson(value);
case 'ImageGeoPoint':
return ImageGeoPoint.fromJson(value);
case 'GeoPointDTOCategorie':
return GeoPointDTOCategorie.fromJson(value);
case 'Instance':
return Instance.fromJson(value);
case 'InstanceDTO':
@ -215,8 +221,14 @@ class ApiClient {
return MapTypeAppTypeTransformer().decode(value);
case 'MenuDTO':
return MenuDTO.fromJson(value);
case 'PdfDTO':
return PdfDTO.fromJson(value);
case 'PlayerMessageDTO':
return PlayerMessageDTO.fromJson(value);
case 'PuzzleDTO':
return PuzzleDTO.fromJson(value);
case 'PuzzleDTOImage':
return PuzzleDTOImage.fromJson(value);
case 'QuestionDTO':
return QuestionDTO.fromJson(value);
case 'QuizzDTO':

View File

@ -0,0 +1,123 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AgendaDTO {
/// Returns a new [AgendaDTO] instance.
AgendaDTO({
this.resourceId,
this.resourceUrl,
});
String? resourceId;
String? resourceUrl;
@override
bool operator ==(Object other) => identical(this, other) || other is AgendaDTO &&
other.resourceId == resourceId &&
other.resourceUrl == resourceUrl;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode);
@override
String toString() => 'AgendaDTO[resourceId=$resourceId, resourceUrl=$resourceUrl]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.resourceId != null) {
json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
return json;
}
/// Returns a new [AgendaDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AgendaDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AgendaDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AgendaDTO[$key]" has a null value in JSON.');
});
return true;
}());
return AgendaDTO(
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
);
}
return null;
}
static List<AgendaDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AgendaDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AgendaDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AgendaDTO> mapFromJson(dynamic json) {
final map = <String, AgendaDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AgendaDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AgendaDTO-objects as value to a dart map
static Map<String, List<AgendaDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AgendaDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AgendaDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -17,7 +17,7 @@ class ArticleDTO {
this.isContentTop,
this.audioIds = const [],
this.isReadAudioAuto,
this.images = const [],
this.contents = const [],
});
List<TranslationDTO>? content;
@ -40,7 +40,7 @@ class ArticleDTO {
///
bool? isReadAudioAuto;
List<ImageDTO>? images;
List<ContentDTO>? contents;
@override
bool operator ==(Object other) => identical(this, other) || other is ArticleDTO &&
@ -48,7 +48,7 @@ class ArticleDTO {
other.isContentTop == isContentTop &&
other.audioIds == audioIds &&
other.isReadAudioAuto == isReadAudioAuto &&
other.images == images;
other.contents == contents;
@override
int get hashCode =>
@ -57,10 +57,10 @@ class ArticleDTO {
(isContentTop == null ? 0 : isContentTop!.hashCode) +
(audioIds == null ? 0 : audioIds!.hashCode) +
(isReadAudioAuto == null ? 0 : isReadAudioAuto!.hashCode) +
(images == null ? 0 : images!.hashCode);
(contents == null ? 0 : contents!.hashCode);
@override
String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]';
String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, contents=$contents]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -84,10 +84,10 @@ class ArticleDTO {
} else {
json[r'isReadAudioAuto'] = null;
}
if (this.images != null) {
json[r'images'] = this.images;
if (this.contents != null) {
json[r'contents'] = this.contents;
} else {
json[r'images'] = null;
json[r'contents'] = null;
}
return json;
}
@ -115,7 +115,7 @@ class ArticleDTO {
isContentTop: mapValueOfType<bool>(json, r'isContentTop'),
audioIds: TranslationDTO.listFromJson(json[r'audioIds']),
isReadAudioAuto: mapValueOfType<bool>(json, r'isReadAudioAuto'),
images: ImageDTO.listFromJson(json[r'images']),
contents: ContentDTO.listFromJson(json[r'contents']),
);
}
return null;

View File

@ -0,0 +1,123 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class CategorieDTO {
/// Returns a new [CategorieDTO] instance.
CategorieDTO({
this.name,
this.icon,
});
String? name;
String? icon;
@override
bool operator ==(Object other) => identical(this, other) || other is CategorieDTO &&
other.name == name &&
other.icon == icon;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(name == null ? 0 : name!.hashCode) +
(icon == null ? 0 : icon!.hashCode);
@override
String toString() => 'CategorieDTO[name=$name, icon=$icon]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.name != null) {
json[r'name'] = this.name;
} else {
json[r'name'] = null;
}
if (this.icon != null) {
json[r'icon'] = this.icon;
} else {
json[r'icon'] = null;
}
return json;
}
/// Returns a new [CategorieDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CategorieDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "CategorieDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "CategorieDTO[$key]" has a null value in JSON.');
});
return true;
}());
return CategorieDTO(
name: mapValueOfType<String>(json, r'name'),
icon: mapValueOfType<String>(json, r'icon'),
);
}
return null;
}
static List<CategorieDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <CategorieDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CategorieDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, CategorieDTO> mapFromJson(dynamic json) {
final map = <String, CategorieDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CategorieDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of CategorieDTO-objects as value to a dart map
static Map<String, List<CategorieDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CategorieDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = CategorieDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -0,0 +1,179 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ContentDTO {
/// Returns a new [ContentDTO] instance.
ContentDTO({
this.title = const [],
this.description = const [],
this.resourceId,
this.resourceUrl,
this.order,
this.resourceType,
});
List<TranslationDTO>? title;
List<TranslationDTO>? description;
String? resourceId;
String? resourceUrl;
///
/// 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;
///
/// 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;
@override
bool operator ==(Object other) => identical(this, other) || other is ContentDTO &&
other.title == title &&
other.description == description &&
other.resourceId == resourceId &&
other.resourceUrl == resourceUrl &&
other.order == order &&
other.resourceType == resourceType;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(title == null ? 0 : title!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode) +
(order == null ? 0 : order!.hashCode) +
(resourceType == null ? 0 : resourceType!.hashCode);
@override
String toString() => 'ContentDTO[title=$title, description=$description, resourceId=$resourceId, resourceUrl=$resourceUrl, order=$order, resourceType=$resourceType]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.title != null) {
json[r'title'] = this.title;
} else {
json[r'title'] = null;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
json[r'description'] = null;
}
if (this.resourceId != null) {
json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
if (this.order != null) {
json[r'order'] = this.order;
} else {
json[r'order'] = null;
}
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'resourceType'] = null;
}
return json;
}
/// Returns a new [ContentDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ContentDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "ContentDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "ContentDTO[$key]" has a null value in JSON.');
});
return true;
}());
return ContentDTO(
title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
order: mapValueOfType<int>(json, r'order'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
);
}
return null;
}
static List<ContentDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ContentDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ContentDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ContentDTO> mapFromJson(dynamic json) {
final map = <String, ContentDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ContentDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ContentDTO-objects as value to a dart map
static Map<String, List<ContentDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ContentDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ContentDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -0,0 +1,151 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ContentGeoPoint {
/// Returns a new [ContentGeoPoint] instance.
ContentGeoPoint({
this.resourceId,
this.resourceType,
this.resourceUrl,
this.latitude,
});
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;
String? latitude;
@override
bool operator ==(Object other) => identical(this, other) || other is ContentGeoPoint &&
other.resourceId == resourceId &&
other.resourceType == resourceType &&
other.resourceUrl == resourceUrl &&
other.latitude == latitude;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceType == null ? 0 : resourceType!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode);
@override
String toString() => 'ContentGeoPoint[resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, latitude=$latitude]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
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.latitude != null) {
json[r'latitude'] = this.latitude;
} else {
json[r'latitude'] = null;
}
return json;
}
/// Returns a new [ContentGeoPoint] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ContentGeoPoint? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "ContentGeoPoint[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "ContentGeoPoint[$key]" has a null value in JSON.');
});
return true;
}());
return ContentGeoPoint(
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
latitude: mapValueOfType<String>(json, r'latitude'),
);
}
return null;
}
static List<ContentGeoPoint> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ContentGeoPoint>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ContentGeoPoint.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ContentGeoPoint> mapFromJson(dynamic json) {
final map = <String, ContentGeoPoint>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ContentGeoPoint.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ContentGeoPoint-objects as value to a dart map
static Map<String, List<ContentGeoPoint>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ContentGeoPoint>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ContentGeoPoint.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -16,7 +16,8 @@ class GeoPointDTO {
this.id,
this.title = const [],
this.description = const [],
this.images = const [],
this.contents = const [],
this.categorie,
this.latitude,
this.longitude,
});
@ -33,7 +34,9 @@ class GeoPointDTO {
List<TranslationDTO>? description;
List<ImageGeoPoint>? images;
List<ContentGeoPoint>? contents;
GeoPointDTOCategorie? categorie;
String? latitude;
@ -44,7 +47,8 @@ class GeoPointDTO {
other.id == id &&
other.title == title &&
other.description == description &&
other.images == images &&
other.contents == contents &&
other.categorie == categorie &&
other.latitude == latitude &&
other.longitude == longitude;
@ -54,12 +58,13 @@ class GeoPointDTO {
(id == null ? 0 : id!.hashCode) +
(title == null ? 0 : title!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(images == null ? 0 : images!.hashCode) +
(contents == null ? 0 : contents!.hashCode) +
(categorie == null ? 0 : categorie!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode) +
(longitude == null ? 0 : longitude!.hashCode);
@override
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, contents=$contents, categorie=$categorie, latitude=$latitude, longitude=$longitude]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -78,10 +83,15 @@ class GeoPointDTO {
} else {
json[r'description'] = null;
}
if (this.images != null) {
json[r'images'] = this.images;
if (this.contents != null) {
json[r'contents'] = this.contents;
} else {
json[r'images'] = null;
json[r'contents'] = null;
}
if (this.categorie != null) {
json[r'categorie'] = this.categorie;
} else {
json[r'categorie'] = null;
}
if (this.latitude != null) {
json[r'latitude'] = this.latitude;
@ -118,7 +128,8 @@ class GeoPointDTO {
id: mapValueOfType<int>(json, r'id'),
title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
images: ImageGeoPoint.listFromJson(json[r'images']),
contents: ContentGeoPoint.listFromJson(json[r'contents']),
categorie: GeoPointDTOCategorie.fromJson(json[r'categorie']),
latitude: mapValueOfType<String>(json, r'latitude'),
longitude: mapValueOfType<String>(json, r'longitude'),
);

View File

@ -0,0 +1,123 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class GeoPointDTOCategorie {
/// Returns a new [GeoPointDTOCategorie] instance.
GeoPointDTOCategorie({
this.name,
this.icon,
});
String? name;
String? icon;
@override
bool operator ==(Object other) => identical(this, other) || other is GeoPointDTOCategorie &&
other.name == name &&
other.icon == icon;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(name == null ? 0 : name!.hashCode) +
(icon == null ? 0 : icon!.hashCode);
@override
String toString() => 'GeoPointDTOCategorie[name=$name, icon=$icon]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.name != null) {
json[r'name'] = this.name;
} else {
json[r'name'] = null;
}
if (this.icon != null) {
json[r'icon'] = this.icon;
} else {
json[r'icon'] = null;
}
return json;
}
/// Returns a new [GeoPointDTOCategorie] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static GeoPointDTOCategorie? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "GeoPointDTOCategorie[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "GeoPointDTOCategorie[$key]" has a null value in JSON.');
});
return true;
}());
return GeoPointDTOCategorie(
name: mapValueOfType<String>(json, r'name'),
icon: mapValueOfType<String>(json, r'icon'),
);
}
return null;
}
static List<GeoPointDTOCategorie> listFromJson(dynamic json, {bool growable = false,}) {
final result = <GeoPointDTOCategorie>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = GeoPointDTOCategorie.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, GeoPointDTOCategorie> mapFromJson(dynamic json) {
final map = <String, GeoPointDTOCategorie>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GeoPointDTOCategorie.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of GeoPointDTOCategorie-objects as value to a dart map
static Map<String, List<GeoPointDTOCategorie>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<GeoPointDTOCategorie>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = GeoPointDTOCategorie.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -18,6 +18,7 @@ class ImageDTO {
this.resourceId,
this.source_,
this.order,
this.type,
});
List<TranslationDTO>? title;
@ -36,13 +37,22 @@ class ImageDTO {
///
int? order;
///
/// 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? type;
@override
bool operator ==(Object other) => identical(this, other) || other is ImageDTO &&
other.title == title &&
other.description == description &&
other.resourceId == resourceId &&
other.source_ == source_ &&
other.order == order;
other.order == order &&
other.type == type;
@override
int get hashCode =>
@ -51,10 +61,11 @@ class ImageDTO {
(description == null ? 0 : description!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(source_ == null ? 0 : source_!.hashCode) +
(order == null ? 0 : order!.hashCode);
(order == null ? 0 : order!.hashCode) +
(type == null ? 0 : type!.hashCode);
@override
String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]';
String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order, type=$type]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -83,6 +94,11 @@ class ImageDTO {
} else {
json[r'order'] = null;
}
if (this.type != null) {
json[r'type'] = this.type;
} else {
json[r'type'] = null;
}
return json;
}
@ -110,6 +126,7 @@ class ImageDTO {
resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'),
order: mapValueOfType<int>(json, r'order'),
type: ResourceType.fromJson(json[r'type']),
);
}
return null;

View File

@ -15,30 +15,41 @@ class LevelDTO {
LevelDTO({
this.label = const [],
this.resourceId,
this.source_,
this.resourceType,
this.resourceUrl,
});
List<TranslationDTO>? label;
String? resourceId;
String? source_;
///
/// 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;
@override
bool operator ==(Object other) => identical(this, other) || other is LevelDTO &&
other.label == label &&
other.resourceId == resourceId &&
other.source_ == source_;
other.resourceType == resourceType &&
other.resourceUrl == resourceUrl;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(label == null ? 0 : label!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(source_ == null ? 0 : source_!.hashCode);
(resourceType == null ? 0 : resourceType!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode);
@override
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]';
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -52,10 +63,15 @@ class LevelDTO {
} else {
json[r'resourceId'] = null;
}
if (this.source_ != null) {
json[r'source'] = this.source_;
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'source'] = null;
json[r'resourceType'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
return json;
}
@ -81,7 +97,8 @@ class LevelDTO {
return LevelDTO(
label: TranslationDTO.listFromJson(json[r'label']),
resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
);
}
return null;

View File

@ -18,6 +18,7 @@ class MapDTO {
this.points = const [],
this.iconResourceId,
this.iconSource,
this.categories = const [],
});
///
@ -42,13 +43,16 @@ class MapDTO {
String? iconSource;
List<CategorieDTO>? categories;
@override
bool operator ==(Object other) => identical(this, other) || other is MapDTO &&
other.zoom == zoom &&
other.mapType == mapType &&
other.points == points &&
other.iconResourceId == iconResourceId &&
other.iconSource == iconSource;
other.iconSource == iconSource &&
other.categories == categories;
@override
int get hashCode =>
@ -57,10 +61,11 @@ class MapDTO {
(mapType == null ? 0 : mapType!.hashCode) +
(points == null ? 0 : points!.hashCode) +
(iconResourceId == null ? 0 : iconResourceId!.hashCode) +
(iconSource == null ? 0 : iconSource!.hashCode);
(iconSource == null ? 0 : iconSource!.hashCode) +
(categories == null ? 0 : categories!.hashCode);
@override
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]';
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource, categories=$categories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -89,6 +94,11 @@ class MapDTO {
} else {
json[r'iconSource'] = null;
}
if (this.categories != null) {
json[r'categories'] = this.categories;
} else {
json[r'categories'] = null;
}
return json;
}
@ -116,6 +126,7 @@ class MapDTO {
points: GeoPointDTO.listFromJson(json[r'points']),
iconResourceId: mapValueOfType<String>(json, r'iconResourceId'),
iconSource: mapValueOfType<String>(json, r'iconSource'),
categories: CategorieDTO.listFromJson(json[r'categories']),
);
}
return null;

View File

@ -0,0 +1,123 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PdfDTO {
/// Returns a new [PdfDTO] instance.
PdfDTO({
this.resourceId,
this.resourceUrl,
});
String? resourceId;
String? resourceUrl;
@override
bool operator ==(Object other) => identical(this, other) || other is PdfDTO &&
other.resourceId == resourceId &&
other.resourceUrl == resourceUrl;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode);
@override
String toString() => 'PdfDTO[resourceId=$resourceId, resourceUrl=$resourceUrl]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.resourceId != null) {
json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
return json;
}
/// Returns a new [PdfDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PdfDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "PdfDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "PdfDTO[$key]" has a null value in JSON.');
});
return true;
}());
return PdfDTO(
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
);
}
return null;
}
static List<PdfDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PdfDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PdfDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PdfDTO> mapFromJson(dynamic json) {
final map = <String, PdfDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PdfDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PdfDTO-objects as value to a dart map
static Map<String, List<PdfDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PdfDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PdfDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -0,0 +1,134 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PuzzleDTO {
/// Returns a new [PuzzleDTO] instance.
PuzzleDTO({
this.messageDebut = const [],
this.messageFin = const [],
this.image,
});
List<TranslationDTO>? messageDebut;
List<TranslationDTO>? messageFin;
PuzzleDTOImage? image;
@override
bool operator ==(Object other) => identical(this, other) || other is PuzzleDTO &&
other.messageDebut == messageDebut &&
other.messageFin == messageFin &&
other.image == image;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(messageDebut == null ? 0 : messageDebut!.hashCode) +
(messageFin == null ? 0 : messageFin!.hashCode) +
(image == null ? 0 : image!.hashCode);
@override
String toString() => 'PuzzleDTO[messageDebut=$messageDebut, messageFin=$messageFin, image=$image]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.messageDebut != null) {
json[r'messageDebut'] = this.messageDebut;
} else {
json[r'messageDebut'] = null;
}
if (this.messageFin != null) {
json[r'messageFin'] = this.messageFin;
} else {
json[r'messageFin'] = null;
}
if (this.image != null) {
json[r'image'] = this.image;
} else {
json[r'image'] = null;
}
return json;
}
/// Returns a new [PuzzleDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PuzzleDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "PuzzleDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "PuzzleDTO[$key]" has a null value in JSON.');
});
return true;
}());
return PuzzleDTO(
messageDebut: TranslationDTO.listFromJson(json[r'messageDebut']),
messageFin: TranslationDTO.listFromJson(json[r'messageFin']),
image: PuzzleDTOImage.fromJson(json[r'image']),
);
}
return null;
}
static List<PuzzleDTO> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PuzzleDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PuzzleDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PuzzleDTO> mapFromJson(dynamic json) {
final map = <String, PuzzleDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PuzzleDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PuzzleDTO-objects as value to a dart map
static Map<String, List<PuzzleDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PuzzleDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PuzzleDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -0,0 +1,179 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PuzzleDTOImage {
/// Returns a new [PuzzleDTOImage] instance.
PuzzleDTOImage({
this.title = const [],
this.description = const [],
this.resourceId,
this.resourceUrl,
this.order,
this.resourceType,
});
List<TranslationDTO>? title;
List<TranslationDTO>? description;
String? resourceId;
String? resourceUrl;
///
/// 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;
///
/// 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;
@override
bool operator ==(Object other) => identical(this, other) || other is PuzzleDTOImage &&
other.title == title &&
other.description == description &&
other.resourceId == resourceId &&
other.resourceUrl == resourceUrl &&
other.order == order &&
other.resourceType == resourceType;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(title == null ? 0 : title!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode) +
(order == null ? 0 : order!.hashCode) +
(resourceType == null ? 0 : resourceType!.hashCode);
@override
String toString() => 'PuzzleDTOImage[title=$title, description=$description, resourceId=$resourceId, resourceUrl=$resourceUrl, order=$order, resourceType=$resourceType]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.title != null) {
json[r'title'] = this.title;
} else {
json[r'title'] = null;
}
if (this.description != null) {
json[r'description'] = this.description;
} else {
json[r'description'] = null;
}
if (this.resourceId != null) {
json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
if (this.order != null) {
json[r'order'] = this.order;
} else {
json[r'order'] = null;
}
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'resourceType'] = null;
}
return json;
}
/// Returns a new [PuzzleDTOImage] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PuzzleDTOImage? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "PuzzleDTOImage[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "PuzzleDTOImage[$key]" has a null value in JSON.');
});
return true;
}());
return PuzzleDTOImage(
title: TranslationDTO.listFromJson(json[r'title']),
description: TranslationDTO.listFromJson(json[r'description']),
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
order: mapValueOfType<int>(json, r'order'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
);
}
return null;
}
static List<PuzzleDTOImage> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PuzzleDTOImage>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PuzzleDTOImage.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PuzzleDTOImage> mapFromJson(dynamic json) {
final map = <String, PuzzleDTOImage>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PuzzleDTOImage.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PuzzleDTOImage-objects as value to a dart map
static Map<String, List<PuzzleDTOImage>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PuzzleDTOImage>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PuzzleDTOImage.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -16,7 +16,8 @@ class QuestionDTO {
this.label = const [],
this.responses = const [],
this.resourceId,
this.source_,
this.resourceType,
this.resourceUrl,
this.order,
});
@ -26,7 +27,15 @@ class QuestionDTO {
String? resourceId;
String? source_;
///
/// 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
@ -41,7 +50,8 @@ class QuestionDTO {
other.label == label &&
other.responses == responses &&
other.resourceId == resourceId &&
other.source_ == source_ &&
other.resourceType == resourceType &&
other.resourceUrl == resourceUrl &&
other.order == order;
@override
@ -50,11 +60,12 @@ class QuestionDTO {
(label == null ? 0 : label!.hashCode) +
(responses == null ? 0 : responses!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(source_ == null ? 0 : source_!.hashCode) +
(resourceType == null ? 0 : resourceType!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode) +
(order == null ? 0 : order!.hashCode);
@override
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -73,10 +84,15 @@ class QuestionDTO {
} else {
json[r'resourceId'] = null;
}
if (this.source_ != null) {
json[r'source'] = this.source_;
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'source'] = null;
json[r'resourceType'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
if (this.order != null) {
json[r'order'] = this.order;
@ -108,7 +124,8 @@ class QuestionDTO {
label: TranslationDTO.listFromJson(json[r'label']),
responses: ResponseDTO.listFromJson(json[r'responses']),
resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
order: mapValueOfType<int>(json, r'order'),
);
}

View File

@ -15,30 +15,41 @@ class QuizzDTOBadLevel {
QuizzDTOBadLevel({
this.label = const [],
this.resourceId,
this.source_,
this.resourceType,
this.resourceUrl,
});
List<TranslationDTO>? label;
String? resourceId;
String? source_;
///
/// 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;
@override
bool operator ==(Object other) => identical(this, other) || other is QuizzDTOBadLevel &&
other.label == label &&
other.resourceId == resourceId &&
other.source_ == source_;
other.resourceType == resourceType &&
other.resourceUrl == resourceUrl;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(label == null ? 0 : label!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(source_ == null ? 0 : source_!.hashCode);
(resourceType == null ? 0 : resourceType!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode);
@override
String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, source_=$source_]';
String toString() => 'QuizzDTOBadLevel[label=$label, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -52,10 +63,15 @@ class QuizzDTOBadLevel {
} else {
json[r'resourceId'] = null;
}
if (this.source_ != null) {
json[r'source'] = this.source_;
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'source'] = null;
json[r'resourceType'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
return json;
}
@ -81,7 +97,8 @@ class QuizzDTOBadLevel {
return QuizzDTOBadLevel(
label: TranslationDTO.listFromJson(json[r'label']),
resourceId: mapValueOfType<String>(json, r'resourceId'),
source_: mapValueOfType<String>(json, r'source'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
);
}
return null;

View File

@ -16,7 +16,7 @@ class ResourceDTO {
this.id,
this.type,
this.label,
this.data,
this.url,
this.dateCreation,
this.instanceId,
});
@ -33,7 +33,7 @@ class ResourceDTO {
String? label;
String? data;
String? url;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -50,7 +50,7 @@ class ResourceDTO {
other.id == id &&
other.type == type &&
other.label == label &&
other.data == data &&
other.url == url &&
other.dateCreation == dateCreation &&
other.instanceId == instanceId;
@ -60,12 +60,12 @@ class ResourceDTO {
(id == null ? 0 : id!.hashCode) +
(type == null ? 0 : type!.hashCode) +
(label == null ? 0 : label!.hashCode) +
(data == null ? 0 : data!.hashCode) +
(url == null ? 0 : url!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode) +
(instanceId == null ? 0 : instanceId!.hashCode);
@override
String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data, dateCreation=$dateCreation, instanceId=$instanceId]';
String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, url=$url, dateCreation=$dateCreation, instanceId=$instanceId]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -84,10 +84,10 @@ class ResourceDTO {
} else {
json[r'label'] = null;
}
if (this.data != null) {
json[r'data'] = this.data;
if (this.url != null) {
json[r'url'] = this.url;
} else {
json[r'data'] = null;
json[r'url'] = null;
}
if (this.dateCreation != null) {
json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
@ -124,7 +124,7 @@ class ResourceDTO {
id: mapValueOfType<String>(json, r'id'),
type: ResourceType.fromJson(json[r'type']),
label: mapValueOfType<String>(json, r'label'),
data: mapValueOfType<String>(json, r'data'),
url: mapValueOfType<String>(json, r'url'),
dateCreation: mapDateTime(json, r'dateCreation', ''),
instanceId: mapValueOfType<String>(json, r'instanceId'),
);

View File

@ -28,6 +28,8 @@ class ResourceType {
static const ImageUrl = ResourceType._(2);
static const VideoUrl = ResourceType._(3);
static const Audio = ResourceType._(4);
static const Pdf = ResourceType._(5);
static const Json = ResourceType._(6);
/// List of all possible values in this [enum][ResourceType].
static const values = <ResourceType>[
@ -35,7 +37,9 @@ class ResourceType {
Video,
ImageUrl,
VideoUrl,
Audio
Audio,
Pdf,
Json
];
static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value);
@ -80,6 +84,8 @@ class ResourceTypeTypeTransformer {
case "ImageUrl": return ResourceType.ImageUrl;
case "VideoUrl": return ResourceType.VideoUrl;
case "Audio": return ResourceType.Audio;
case "PDF": return ResourceType.Pdf;
case "JSON": return ResourceType.Json;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
@ -93,6 +99,8 @@ class ResourceTypeTypeTransformer {
case 2: return ResourceType.ImageUrl;
case 3: return ResourceType.VideoUrl;
case 4: return ResourceType.Audio;
case 5: return ResourceType.Pdf;
case 6: return ResourceType.Json;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');

View File

@ -13,29 +13,29 @@ part of openapi.api;
class SliderDTO {
/// Returns a new [SliderDTO] instance.
SliderDTO({
this.images = const [],
this.contents = const [],
});
List<ImageDTO>? images;
List<ContentDTO>? contents;
@override
bool operator ==(Object other) => identical(this, other) || other is SliderDTO &&
other.images == images;
other.contents == contents;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(images == null ? 0 : images!.hashCode);
(contents == null ? 0 : contents!.hashCode);
@override
String toString() => 'SliderDTO[images=$images]';
String toString() => 'SliderDTO[contents=$contents]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.images != null) {
json[r'images'] = this.images;
if (this.contents != null) {
json[r'contents'] = this.contents;
} else {
json[r'images'] = null;
json[r'contents'] = null;
}
return json;
}
@ -59,7 +59,7 @@ class SliderDTO {
}());
return SliderDTO(
images: ImageDTO.listFromJson(json[r'images']),
contents: ContentDTO.listFromJson(json[r'contents']),
);
}
return null;

View File

@ -0,0 +1,27 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for AgendaDTO
void main() {
// final instance = AgendaDTO();
group('test AgendaDTO', () {
// String resourceId
test('to test the property `resourceId`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,32 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for CategorieDTO
void main() {
// final instance = CategorieDTO();
group('test CategorieDTO', () {
// String name
test('to test the property `name`', () async {
// TODO
});
// String icon
test('to test the property `icon`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,52 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for ContentDTO
void main() {
// final instance = ContentDTO();
group('test ContentDTO', () {
// List<TranslationDTO> title (default value: const [])
test('to test the property `title`', () async {
// TODO
});
// List<TranslationDTO> description (default value: const [])
test('to test the property `description`', () async {
// TODO
});
// String resourceId
test('to test the property `resourceId`', () async {
// TODO
});
// String resourceUrl
test('to test the property `resourceUrl`', () async {
// TODO
});
// int order
test('to test the property `order`', () async {
// TODO
});
// ResourceType resourceType
test('to test the property `resourceType`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,42 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for ContentGeoPoint
void main() {
// final instance = ContentGeoPoint();
group('test ContentGeoPoint', () {
// String resourceId
test('to test the property `resourceId`', () async {
// TODO
});
// ResourceType resourceType
test('to test the property `resourceType`', () async {
// TODO
});
// String resourceUrl
test('to test the property `resourceUrl`', () async {
// TODO
});
// String latitude
test('to test the property `latitude`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,32 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for GeoPointDTOCategorie
void main() {
// final instance = GeoPointDTOCategorie();
group('test GeoPointDTOCategorie', () {
// String name
test('to test the property `name`', () async {
// TODO
});
// String icon
test('to test the property `icon`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,27 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for PdfDTO
void main() {
// final instance = PdfDTO();
group('test PdfDTO', () {
// String resourceId
test('to test the property `resourceId`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,52 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for PuzzleDTOImage
void main() {
// final instance = PuzzleDTOImage();
group('test PuzzleDTOImage', () {
// List<TranslationDTO> title (default value: const [])
test('to test the property `title`', () async {
// TODO
});
// List<TranslationDTO> description (default value: const [])
test('to test the property `description`', () async {
// TODO
});
// String resourceId
test('to test the property `resourceId`', () async {
// TODO
});
// String source_
test('to test the property `source_`', () async {
// TODO
});
// int order
test('to test the property `order`', () async {
// TODO
});
// ResourceType type
test('to test the property `type`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,37 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:manager_api_new/api.dart';
import 'package:test/test.dart';
// tests for PuzzleDTO
void main() {
// final instance = PuzzleDTO();
group('test PuzzleDTO', () {
// List<TranslationDTO> messageDebut (default value: const [])
test('to test the property `messageDebut`', () async {
// TODO
});
// List<TranslationDTO> messageFin (default value: const [])
test('to test the property `messageFin`', () async {
// TODO
});
// PuzzleDTOImage image
test('to test the property `image`', () async {
// TODO
});
});
}