Wip new quizz section

This commit is contained in:
Fransolet Thomas 2022-03-23 23:54:11 +01:00
parent 6a1ab92be7
commit 792d43e931
41 changed files with 3902 additions and 160 deletions

View File

@ -0,0 +1,54 @@
import 'package:managerapi/api.dart';
class ResponseSubDTO {
List<TranslationDTO> label;
bool isGood;
int order;
ResponseSubDTO({this.label, this.isGood, this.order});
//ResponseSubDTO(List<TranslationDTO> label, bool isGood, int order) : super();
List<ResponseSubDTO> fromJSON(List<ResponseDTO> responsesDTO) {
List<ResponseSubDTO> responsesSubDTO = <ResponseSubDTO>[];
for(ResponseDTO responseDTO in responsesDTO)
{
responsesSubDTO.add(new ResponseSubDTO(
label: responseDTO.label,
isGood: responseDTO.isGood,
order: responseDTO.order,
));
}
return responsesSubDTO;
}
}
class QuestionSubDTO {
List<TranslationDTO> label;
List<ResponseSubDTO> responsesSubDTO;
int chosen;
String resourceId;
String source_;
int order;
QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order});
List<QuestionSubDTO> fromJSON(List<QuestionDTO> questionsDTO) {
List<QuestionSubDTO> questionSubDTO = <QuestionSubDTO>[];
for(QuestionDTO questionDTO in questionsDTO)
{
questionSubDTO.add(new QuestionSubDTO(
chosen: null,
label: questionDTO.label,
responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses),
resourceId: questionDTO.resourceId,
source_: questionDTO.source_,
order: questionDTO.order,
));
}
return questionSubDTO;
}
}

View File

@ -18,6 +18,7 @@ import 'package:tablet_app/app_context.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import '../Quizz/quizz_view.dart';
import 'language_selection.dart'; import 'language_selection.dart';
class MainViewWidget extends StatefulWidget { class MainViewWidget extends StatefulWidget {
@ -72,8 +73,11 @@ class _MainViewWidget extends State<MainViewWidget> {
case SectionType.menu : case SectionType.menu :
elementToShow = MenuViewWidget(section: sectionSelected); elementToShow = MenuViewWidget(section: sectionSelected);
break; break;
case SectionType.quizz :
elementToShow = QuizzViewWidget(section: sectionSelected);
break;
default: default:
elementToShow = Text('Hellow default'); elementToShow = Text("Ce type n'est pas supporté");
break; break;
} }
return Scaffold( return Scaffold(

View File

@ -0,0 +1,430 @@
import 'dart:convert';
import 'dart:math';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:confetti/confetti.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:managerapi/api.dart';
import 'package:provider/provider.dart';
import 'package:tablet_app/Models/ResponseSubDTO.dart';
import 'package:tablet_app/app_context.dart';
import 'package:tablet_app/constants.dart';
class QuizzViewWidget extends StatefulWidget {
final SectionDTO section;
GlobalKey<ScaffoldState> key;
QuizzViewWidget({this.section, this.key});
@override
_QuizzViewWidget createState() => _QuizzViewWidget();
}
class _QuizzViewWidget extends State<QuizzViewWidget> {
ConfettiController _controllerCenter;
QuizzDTO quizzDTO;
List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[];
CarouselController sliderController;
int currentIndex = 1;
bool showResult = false;
@override
void initState() {
super.initState();
_controllerCenter = ConfettiController(duration: const Duration(seconds: 10));
sliderController = CarouselController();
quizzDTO = QuizzDTO.fromJson(jsonDecode(widget.section.data));
quizzDTO.questions.sort((a, b) => a.order.compareTo(b.order));
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions);
_controllerCenter.play();
}
@override
void dispose() {
sliderController = null;
_controllerCenter.dispose();
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions);
super.dispose();
}
/// A custom Path to paint stars.
Path drawStar(Size size) {
// Method to convert degree to radians
double degToRad(double deg) => deg * (pi / 180.0);
const numberOfPoints = 5;
final halfWidth = size.width / 2;
final externalRadius = halfWidth;
final internalRadius = halfWidth / 2.5;
final degreesPerStep = degToRad(360 / numberOfPoints);
final halfDegreesPerStep = degreesPerStep / 2;
/*final path = Path();
final fullAngle = degToRad(360);
path.moveTo(size.width, halfWidth);
for (double step = 0; step < fullAngle; step += degreesPerStep) {
path.lineTo(halfWidth + externalRadius * cos(step),
halfWidth + externalRadius * sin(step));
path.lineTo(halfWidth + internalRadius * cos(step + halfDegreesPerStep),
halfWidth + internalRadius * sin(step + halfDegreesPerStep));
}*/
var path = Path();
path.lineTo(size.width * 0.57, size.height);
path.cubicTo(size.width * 0.56, size.height, size.width * 0.53, size.height * 0.97, size.width * 0.51, size.height * 0.96);
path.cubicTo(size.width * 0.49, size.height * 0.94, size.width * 0.47, size.height * 0.89, size.width * 0.47, size.height * 0.85);
path.cubicTo(size.width * 0.47, size.height * 0.85, size.width * 0.46, size.height * 0.84, size.width * 0.46, size.height * 0.84);
path.cubicTo(size.width * 0.46, size.height * 0.84, size.width * 0.44, size.height * 0.85, size.width * 0.44, size.height * 0.85);
path.cubicTo(size.width * 0.4, size.height * 0.88, size.width * 0.38, size.height * 0.89, size.width * 0.34, size.height * 0.91);
path.cubicTo(size.width * 0.28, size.height * 0.93, size.width * 0.22, size.height * 0.94, size.width * 0.15, size.height * 0.93);
path.cubicTo(size.width * 0.11, size.height * 0.93, size.width * 0.09, size.height * 0.93, size.width * 0.07, size.height * 0.93);
path.cubicTo(size.width * 0.02, size.height * 0.92, size.width * 0.02, size.height * 0.91, size.width * 0.03, size.height * 0.89);
path.cubicTo(size.width * 0.05, size.height * 0.84, size.width * 0.09, size.height * 0.79, size.width * 0.15, size.height * 0.76);
path.cubicTo(size.width * 0.17, size.height * 0.75, size.width * 0.19, size.height * 0.74, size.width / 5, size.height * 0.74);
path.cubicTo(size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73);
path.cubicTo(size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73, size.width * 0.22, size.height * 0.73);
path.cubicTo(size.width / 5, size.height * 0.73, size.width * 0.16, size.height * 0.71, size.width * 0.14, size.height * 0.7);
path.cubicTo(size.width * 0.13, size.height * 0.7, size.width * 0.12, size.height * 0.69, size.width * 0.11, size.height * 0.69);
path.cubicTo(size.width * 0.1, size.height * 0.68, size.width * 0.07, size.height * 0.66, size.width * 0.06, size.height * 0.65);
path.cubicTo(0, size.height * 0.6, -0.01, size.height * 0.54, size.width * 0.02, size.height * 0.45);
path.cubicTo(size.width * 0.03, size.height * 0.4, size.width * 0.06, size.height * 0.35, size.width * 0.1, size.height * 0.29);
path.cubicTo(size.width * 0.13, size.height / 4, size.width * 0.15, size.height * 0.23, size.width * 0.18, size.height * 0.19);
path.cubicTo(size.width * 0.24, size.height * 0.14, size.width * 0.28, size.height * 0.1, size.width * 0.35, size.height * 0.06);
path.cubicTo(size.width * 0.42, size.height * 0.01, size.width * 0.47, 0, size.width * 0.51, 0);
path.cubicTo(size.width * 0.58, size.height * 0.01, size.width * 0.66, size.height * 0.06, size.width * 0.75, size.height * 0.14);
path.cubicTo(size.width * 0.87, size.height * 0.24, size.width * 0.97, size.height * 0.37, size.width, size.height * 0.46);
path.cubicTo(size.width, size.height * 0.52, size.width, size.height * 0.56, size.width * 0.97, size.height * 0.6);
path.cubicTo(size.width * 0.95, size.height * 0.62, size.width * 0.93, size.height * 0.64, size.width * 0.9, size.height * 0.66);
path.cubicTo(size.width * 0.89, size.height * 0.67, size.width * 0.88, size.height * 0.68, size.width * 0.84, size.height * 0.7);
path.cubicTo(size.width * 0.84, size.height * 0.7, size.width * 0.83, size.height * 0.7, size.width * 0.83, size.height * 0.7);
path.cubicTo(size.width * 0.83, size.height * 0.7, size.width * 0.84, size.height * 0.71, size.width * 0.85, size.height * 0.72);
path.cubicTo(size.width * 0.9, size.height * 0.75, size.width * 0.93, size.height * 0.78, size.width * 0.97, size.height * 0.82);
path.cubicTo(size.width * 0.98, size.height * 0.84, size.width, size.height * 0.85, size.width, size.height * 0.85);
path.cubicTo(size.width, size.height * 0.86, size.width * 0.98, size.height * 0.87, size.width * 0.97, size.height * 0.87);
path.cubicTo(size.width * 0.95, size.height * 0.88, size.width * 0.85, size.height * 0.88, size.width * 0.77, size.height * 0.88);
path.cubicTo(size.width * 0.7, size.height * 0.88, size.width * 0.67, size.height * 0.88, size.width * 0.61, size.height * 0.86);
path.cubicTo(size.width * 0.6, size.height * 0.86, size.width * 0.59, size.height * 0.86, size.width * 0.59, size.height * 0.86);
path.cubicTo(size.width * 0.59, size.height * 0.86, size.width * 0.61, size.height * 0.88, size.width * 0.62, size.height * 0.9);
path.cubicTo(size.width * 0.64, size.height * 0.93, size.width * 0.65, size.height * 0.93, size.width * 0.65, size.height * 0.95);
path.cubicTo(size.width * 0.65, size.height * 0.96, size.width * 0.64, size.height * 0.97, size.width * 0.63, size.height * 0.97);
path.cubicTo(size.width * 0.62, size.height * 0.97, size.width * 0.62, size.height * 0.98, size.width * 0.62, size.height * 0.98);
path.cubicTo(size.width * 0.62, size.height, size.width * 0.61, size.height, size.width * 0.6, size.height);
path.cubicTo(size.width * 0.59, size.height, size.width * 0.58, size.height, size.width * 0.57, size.height);
path.cubicTo(size.width * 0.57, size.height, size.width * 0.57, size.height, size.width * 0.57, size.height);
path.lineTo(size.width * 0.58, size.height * 0.94);
path.cubicTo(size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.93);
path.cubicTo(size.width * 0.57, size.height * 0.93, size.width * 0.54, size.height * 0.89, size.width * 0.54, size.height * 0.88);
path.cubicTo(size.width * 0.53, size.height * 0.88, size.width * 0.53, size.height * 0.88, size.width * 0.54, size.height * 0.89);
path.cubicTo(size.width * 0.55, size.height * 0.91, size.width * 0.56, size.height * 0.93, size.width * 0.57, size.height * 0.94);
path.cubicTo(size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94);
path.cubicTo(size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94, size.width * 0.58, size.height * 0.94);
path.lineTo(size.width * 0.19, size.height * 0.89);
path.cubicTo(size.width / 4, size.height * 0.89, size.width * 0.3, size.height * 0.88, size.width * 0.34, size.height * 0.86);
path.cubicTo(size.width * 0.39, size.height * 0.84, size.width * 0.43, size.height * 0.8, size.width * 0.45, size.height * 0.77);
path.cubicTo(size.width * 0.46, size.height * 0.76, size.width * 0.46, size.height * 0.75, size.width * 0.45, size.height * 0.75);
path.cubicTo(size.width * 0.44, size.height * 0.75, size.width * 0.37, size.height * 0.75, size.width / 3, size.height * 0.75);
path.cubicTo(size.width * 0.29, size.height * 0.75, size.width * 0.24, size.height * 0.77, size.width / 5, size.height * 0.79);
path.cubicTo(size.width * 0.18, size.height * 0.8, size.width * 0.15, size.height * 0.82, size.width * 0.13, size.height * 0.83);
path.cubicTo(size.width * 0.12, size.height * 0.85, size.width * 0.1, size.height * 0.87, size.width * 0.09, size.height * 0.88);
path.cubicTo(size.width * 0.09, size.height * 0.89, size.width * 0.09, size.height * 0.89, size.width * 0.11, size.height * 0.89);
path.cubicTo(size.width * 0.15, size.height * 0.9, size.width * 0.17, size.height * 0.9, size.width * 0.19, size.height * 0.89);
path.cubicTo(size.width * 0.19, size.height * 0.89, size.width * 0.19, size.height * 0.89, size.width * 0.19, size.height * 0.89);
path.lineTo(size.width * 0.87, size.height * 0.84);
path.cubicTo(size.width * 0.9, size.height * 0.84, size.width * 0.91, size.height * 0.84, size.width * 0.91, size.height * 0.84);
path.cubicTo(size.width * 0.91, size.height * 0.83, size.width * 0.9, size.height * 0.83, size.width * 0.9, size.height * 0.82);
path.cubicTo(size.width * 0.85, size.height * 0.77, size.width * 0.79, size.height * 0.73, size.width * 0.73, size.height * 0.72);
path.cubicTo(size.width * 0.71, size.height * 0.71, size.width * 0.7, size.height * 0.71, size.width * 0.67, size.height * 0.71);
path.cubicTo(size.width * 0.66, size.height * 0.71, size.width * 0.65, size.height * 0.71, size.width * 0.64, size.height * 0.71);
path.cubicTo(size.width * 0.61, size.height * 0.72, size.width * 0.57, size.height * 0.73, size.width * 0.55, size.height * 0.74);
path.cubicTo(size.width * 0.54, size.height * 0.74, size.width * 0.53, size.height * 0.75, size.width * 0.53, size.height * 0.75);
path.cubicTo(size.width * 0.53, size.height * 0.75, size.width * 0.54, size.height * 0.77, size.width * 0.54, size.height * 0.77);
path.cubicTo(size.width * 0.56, size.height * 0.8, size.width * 0.59, size.height * 0.81, size.width * 0.63, size.height * 0.82);
path.cubicTo(size.width * 0.66, size.height * 0.83, size.width * 0.7, size.height * 0.84, size.width * 0.74, size.height * 0.84);
path.cubicTo(size.width * 0.76, size.height * 0.84, size.width * 0.84, size.height * 0.84, size.width * 0.87, size.height * 0.84);
path.cubicTo(size.width * 0.87, size.height * 0.84, size.width * 0.87, size.height * 0.84, size.width * 0.87, size.height * 0.84);
path.lineTo(size.width / 2, size.height * 0.71);
path.cubicTo(size.width / 2, size.height * 0.71, size.width * 0.51, size.height * 0.71, size.width * 0.51, size.height * 0.7);
path.cubicTo(size.width * 0.55, size.height * 0.69, size.width * 0.59, size.height * 0.68, size.width * 0.63, size.height * 0.67);
path.cubicTo(size.width * 0.63, size.height * 0.67, size.width * 0.65, size.height * 0.67, size.width * 0.67, size.height * 0.67);
path.cubicTo(size.width * 0.67, size.height * 0.67, size.width * 0.71, size.height * 0.67, size.width * 0.71, size.height * 0.67);
path.cubicTo(size.width * 0.71, size.height * 0.67, size.width * 0.74, size.height * 0.68, size.width * 0.74, size.height * 0.68);
path.cubicTo(size.width * 0.74, size.height * 0.68, size.width * 0.76, size.height * 0.68, size.width * 0.76, size.height * 0.68);
path.cubicTo(size.width * 0.76, size.height * 0.68, size.width * 0.77, size.height * 0.67, size.width * 0.77, size.height * 0.67);
path.cubicTo(size.width * 0.82, size.height * 0.66, size.width * 0.87, size.height * 0.63, size.width * 0.89, size.height * 0.61);
path.cubicTo(size.width * 0.94, size.height * 0.57, size.width * 0.95, size.height * 0.51, size.width * 0.93, size.height * 0.44);
path.cubicTo(size.width * 0.88, size.height * 0.31, size.width * 0.7, size.height * 0.12, size.width * 0.56, size.height * 0.06);
path.cubicTo(size.width * 0.52, size.height * 0.04, size.width / 2, size.height * 0.04, size.width * 0.47, size.height * 0.05);
path.cubicTo(size.width * 0.4, size.height * 0.06, size.width * 0.29, size.height * 0.14, size.width / 5, size.height * 0.24);
path.cubicTo(size.width * 0.13, size.height / 3, size.width * 0.08, size.height * 0.41, size.width * 0.07, size.height * 0.49);
path.cubicTo(size.width * 0.06, size.height * 0.51, size.width * 0.06, size.height * 0.55, size.width * 0.07, size.height * 0.57);
path.cubicTo(size.width * 0.07, size.height * 0.58, size.width * 0.08, size.height * 0.59, size.width * 0.09, size.height * 0.6);
path.cubicTo(size.width * 0.1, size.height * 0.62, size.width * 0.11, size.height * 0.63, size.width * 0.12, size.height * 0.64);
path.cubicTo(size.width * 0.16, size.height * 0.67, size.width * 0.22, size.height * 0.69, size.width * 0.3, size.height * 0.7);
path.cubicTo(size.width / 3, size.height * 0.7, size.width / 3, size.height * 0.71, size.width * 0.41, size.height * 0.71);
path.cubicTo(size.width * 0.44, size.height * 0.71, size.width * 0.45, size.height * 0.71, size.width * 0.46, size.height * 0.71);
path.cubicTo(size.width * 0.48, size.height * 0.71, size.width * 0.49, size.height * 0.71, size.width / 2, size.height * 0.71);
path.cubicTo(size.width / 2, size.height * 0.71, size.width / 2, size.height * 0.71, size.width / 2, size.height * 0.71);
return path;
}
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
final appContext = Provider.of<AppContext>(context);
if(showResult)
return Column(
children: [
Center(
child: Container(
width: 250,
height: 250,
color: Colors.green,
child: ConfettiWidget(
confettiController: _controllerCenter,
blastDirectionality: BlastDirectionality
.explosive, // don't specify a direction, blast randomly
shouldLoop:
true, // start again as soon as the animation is finished
colors: const [
Colors.red,
Colors.pink,
Colors.orange,
Colors.purple
], // manually specify the colors to be used
createParticlePath: drawStar, // define a custom shape/path.
),
),
),
Text("RESULT TODO"),
],
);
else
return Stack(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if(_questionsSubDTO != null && _questionsSubDTO.length > 0)
CarouselSlider(
carouselController: sliderController,
options: CarouselOptions(
onPageChanged: (int index, CarouselPageChangedReason reason) {
setState(() {
currentIndex = index + 1;
});
},
height: MediaQuery.of(context).size.height * 0.8,
enlargeCenterPage: true,
scrollPhysics: NeverScrollableScrollPhysics(),
reverse: false,
),
items: _questionsSubDTO.map<Widget>((i) {
return Builder(
builder: (BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
margin: EdgeInsets.symmetric(horizontal: 5.0),
decoration: BoxDecoration(
color: kBackgroundLight,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(20.0),
image: i.source_ != null ? new DecorationImage(
fit: BoxFit.contain,
opacity: 0.35,
image: new NetworkImage(
i.source_,
),
): null,
boxShadow: [
BoxShadow(
color: kBackgroundSecondGrey,
spreadRadius: 0.5,
blurRadius: 5,
offset: Offset(0, 1.5), // changes position of shadow
),
],
),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
//width: MediaQuery.of(context).size.width *0.65,
height: MediaQuery.of(context).size.height *0.25,
child: Stack(
children: [
Center(
child: Container(
decoration: BoxDecoration(
color: kBackgroundLight,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0),
boxShadow: [
BoxShadow(
color: kBackgroundSecondGrey,
spreadRadius: 0.3,
blurRadius: 4,
offset: Offset(0, 2), // changes position of shadow
),
],
),
width: MediaQuery.of(context).size.width *0.65,
height: MediaQuery.of(context).size.height *0.18,
child: Center(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Text(i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)),
),
),
),
)
),
]
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.05,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
height: MediaQuery.of(context).size.height * 0.6,
width: MediaQuery.of(context).size.width * 0.72,
//color: Colors.green,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisExtent: 150,
mainAxisSpacing: 150,
crossAxisSpacing: 150,
),
itemCount: i.responsesSubDTO.length,
itemBuilder: (BuildContext ctx, index) {
return InkWell(
onTap: () {
setState(() {
i.chosen = index;
if(currentIndex == _questionsSubDTO.length && i.chosen == index)
{
showResult = true;
_controllerCenter.play();
}
});
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
alignment: Alignment.center,
child: Text(i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)),
decoration: BoxDecoration(
color: i.chosen == index ? Colors.green : kBackgroundLight,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0),
boxShadow: [
BoxShadow(
color: kBackgroundSecondGrey,
spreadRadius: 0.3,
blurRadius: 4,
offset: Offset(0, 2), // changes position of shadow
),
],
),
),
),
);
}),
),
),
),
),
],
)
),
);
},
);
}).toList(),
),
],
),
if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length)
Positioned(
top: MediaQuery.of(context).size.height * 0.35,
right: 60,
child: InkWell(
onTap: () {
if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) {
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
} else {
Fluttertoast.showToast(
msg: "Vous n'avez pas répondu à cette question",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: kMainRed,
textColor: Colors.white,
fontSize: 35.0
);
}
},
child: Icon(
Icons.chevron_right,
size: 150,
color: kMainRed,
),
)
),
if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != 1)
Positioned(
top: MediaQuery.of(context).size.height * 0.35,
left: 60,
child: InkWell(
onTap: () {
if(currentIndex > 1)
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
},
child: Icon(
Icons.chevron_left,
size: 150,
color: kMainRed,
),
)
),
if(_questionsSubDTO != null && _questionsSubDTO.length > 0)
Padding(
padding: const EdgeInsets.only(bottom: 0),
child: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
child: Text(
currentIndex.toString()+'/'+quizzDTO.questions.length.toString(),
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500),
),
)
),
),
if(_questionsSubDTO == null || _questionsSubDTO.length == 0)
Center(child: Text("Aucune question à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),))
]
);
}
}

View File

@ -8,18 +8,23 @@ doc/DeviceApi.md
doc/DeviceDTO.md doc/DeviceDTO.md
doc/DeviceDetailDTO.md doc/DeviceDetailDTO.md
doc/DeviceDetailDTOAllOf.md doc/DeviceDetailDTOAllOf.md
doc/ExportConfigurationDTO.md
doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md doc/GeoPointDTO.md
doc/ImageDTO.md doc/ImageDTO.md
doc/ImageGeoPoint.md doc/ImageGeoPoint.md
doc/LevelDTO.md
doc/LoginDTO.md doc/LoginDTO.md
doc/MapDTO.md doc/MapDTO.md
doc/MapTypeApp.md doc/MapTypeApp.md
doc/MenuDTO.md doc/MenuDTO.md
doc/PlayerMessageDTO.md doc/PlayerMessageDTO.md
doc/QuestionDTO.md
doc/QuizzDTO.md
doc/ResourceApi.md doc/ResourceApi.md
doc/ResourceDTO.md doc/ResourceDTO.md
doc/ResourceDetailDTO.md
doc/ResourceType.md doc/ResourceType.md
doc/ResponseDTO.md
doc/SectionApi.md doc/SectionApi.md
doc/SectionDTO.md doc/SectionDTO.md
doc/SectionType.md doc/SectionType.md
@ -51,17 +56,22 @@ lib/model/configuration_dto.dart
lib/model/device_detail_dto.dart lib/model/device_detail_dto.dart
lib/model/device_detail_dto_all_of.dart lib/model/device_detail_dto_all_of.dart
lib/model/device_dto.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/geo_point_dto.dart
lib/model/image_dto.dart lib/model/image_dto.dart
lib/model/image_geo_point.dart lib/model/image_geo_point.dart
lib/model/level_dto.dart
lib/model/login_dto.dart lib/model/login_dto.dart
lib/model/map_dto.dart lib/model/map_dto.dart
lib/model/map_type_app.dart lib/model/map_type_app.dart
lib/model/menu_dto.dart lib/model/menu_dto.dart
lib/model/player_message_dto.dart lib/model/player_message_dto.dart
lib/model/resource_detail_dto.dart lib/model/question_dto.dart
lib/model/quizz_dto.dart
lib/model/resource_dto.dart lib/model/resource_dto.dart
lib/model/resource_type.dart lib/model/resource_type.dart
lib/model/response_dto.dart
lib/model/section_dto.dart lib/model/section_dto.dart
lib/model/section_type.dart lib/model/section_type.dart
lib/model/slider_dto.dart lib/model/slider_dto.dart
@ -72,3 +82,9 @@ lib/model/user_detail_dto.dart
lib/model/video_dto.dart lib/model/video_dto.dart
lib/model/web_dto.dart lib/model/web_dto.dart
pubspec.yaml pubspec.yaml
test/export_configuration_dto_all_of_test.dart
test/export_configuration_dto_test.dart
test/level_dto_test.dart
test/question_dto_test.dart
test/quizz_dto_test.dart
test/response_dto_test.dart

View File

@ -60,7 +60,7 @@ try {
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
@ -68,8 +68,10 @@ Class | Method | HTTP request | Description
*AuthenticationApi* | [**authenticationAuthenticateWithJson**](doc\/AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate | *AuthenticationApi* | [**authenticationAuthenticateWithJson**](doc\/AuthenticationApi.md#authenticationauthenticatewithjson) | **POST** /api/Authentication/Authenticate |
*ConfigurationApi* | [**configurationCreate**](doc\/ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration | *ConfigurationApi* | [**configurationCreate**](doc\/ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration |
*ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | *ConfigurationApi* | [**configurationDelete**](doc\/ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationExport**](doc\/ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
*ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration | *ConfigurationApi* | [**configurationGet**](doc\/ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
*ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | *ConfigurationApi* | [**configurationGetDetail**](doc\/ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
*ConfigurationApi* | [**configurationImport**](doc\/ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
*ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | *ConfigurationApi* | [**configurationUpdate**](doc\/ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
*DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/Device | *DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/Device |
*DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} | *DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/Device/{id} |
@ -93,6 +95,7 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | *SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | *SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
*SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | *SectionApi* | [**sectionGetMenuDTO**](doc\/SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO |
*SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | *SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | *SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | *SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
@ -112,17 +115,22 @@ Class | Method | HTTP request | Description
- [DeviceDTO](doc\/DeviceDTO.md) - [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md) - [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md) - [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
- [ExportConfigurationDTO](doc\/ExportConfigurationDTO.md)
- [ExportConfigurationDTOAllOf](doc\/ExportConfigurationDTOAllOf.md)
- [GeoPointDTO](doc\/GeoPointDTO.md) - [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md) - [ImageDTO](doc\/ImageDTO.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [LevelDTO](doc\/LevelDTO.md)
- [LoginDTO](doc\/LoginDTO.md) - [LoginDTO](doc\/LoginDTO.md)
- [MapDTO](doc\/MapDTO.md) - [MapDTO](doc\/MapDTO.md)
- [MapTypeApp](doc\/MapTypeApp.md) - [MapTypeApp](doc\/MapTypeApp.md)
- [MenuDTO](doc\/MenuDTO.md) - [MenuDTO](doc\/MenuDTO.md)
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
- [QuestionDTO](doc\/QuestionDTO.md)
- [QuizzDTO](doc\/QuizzDTO.md)
- [ResourceDTO](doc\/ResourceDTO.md) - [ResourceDTO](doc\/ResourceDTO.md)
- [ResourceDetailDTO](doc\/ResourceDetailDTO.md)
- [ResourceType](doc\/ResourceType.md) - [ResourceType](doc\/ResourceType.md)
- [ResponseDTO](doc\/ResponseDTO.md)
- [SectionDTO](doc\/SectionDTO.md) - [SectionDTO](doc\/SectionDTO.md)
- [SectionType](doc\/SectionType.md) - [SectionType](doc\/SectionType.md)
- [SliderDTO](doc\/SliderDTO.md) - [SliderDTO](doc\/SliderDTO.md)

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
``` ```
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -5,14 +5,16 @@
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
``` ```
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**configurationCreate**](ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration | [**configurationCreate**](ConfigurationApi.md#configurationcreate) | **POST** /api/Configuration |
[**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} | [**configurationDelete**](ConfigurationApi.md#configurationdelete) | **DELETE** /api/Configuration/{id} |
[**configurationExport**](ConfigurationApi.md#configurationexport) | **GET** /api/Configuration/{id}/export |
[**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration | [**configurationGet**](ConfigurationApi.md#configurationget) | **GET** /api/Configuration |
[**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} | [**configurationGetDetail**](ConfigurationApi.md#configurationgetdetail) | **GET** /api/Configuration/{id} |
[**configurationImport**](ConfigurationApi.md#configurationimport) | **POST** /api/Configuration/import |
[**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration | [**configurationUpdate**](ConfigurationApi.md#configurationupdate) | **PUT** /api/Configuration |
@ -102,6 +104,49 @@ 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) [[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)
# **configurationExport**
> ExportConfigurationDTO configurationExport(id)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi();
final id = id_example; // String |
try {
final result = api_instance.configurationExport(id);
print(result);
} catch (e) {
print('Exception when calling ConfigurationApi->configurationExport: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**ExportConfigurationDTO**](ExportConfigurationDTO.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)
# **configurationGet** # **configurationGet**
> List<ConfigurationDTO> configurationGet() > List<ConfigurationDTO> configurationGet()
@ -184,6 +229,49 @@ 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) [[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)
# **configurationImport**
> String configurationImport(exportConfigurationDTO)
### Example
```dart
import 'package:managerapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi();
final exportConfigurationDTO = ExportConfigurationDTO(); // ExportConfigurationDTO |
try {
final result = api_instance.configurationImport(exportConfigurationDTO);
print(result);
} catch (e) {
print('Exception when calling ConfigurationApi->configurationImport: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**exportConfigurationDTO** | [**ExportConfigurationDTO**](ExportConfigurationDTO.md)| |
### Return type
**String**
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **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)
# **configurationUpdate** # **configurationUpdate**
> ConfigurationDTO configurationUpdate(configurationDTO) > ConfigurationDTO configurationUpdate(configurationDTO)

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
``` ```
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -0,0 +1,22 @@
# managerapi.model.ExportConfigurationDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**label** | **String** | | [optional]
**primaryColor** | **String** | | [optional]
**secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.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 @@
# managerapi.model.ExportConfigurationDTOAllOf
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.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,17 @@
# managerapi.model.LevelDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**source_** | **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,19 @@
# managerapi.model.QuestionDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
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]
**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

@ -0,0 +1,19 @@
# managerapi.model.QuizzDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**questions** | [**List<QuestionDTO>**](QuestionDTO.md) | | [optional] [default to const []]
**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.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:managerapi/api.dart'; import 'package:managerapi/api.dart';
``` ```
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -19,7 +19,7 @@ Method | HTTP request | Description
# **resourceCreate** # **resourceCreate**
> ResourceDetailDTO resourceCreate(resourceDetailDTO) > ResourceDTO resourceCreate(resourceDTO)
@ -30,10 +30,10 @@ import 'package:managerapi/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final resourceDetailDTO = ResourceDetailDTO(); // ResourceDetailDTO | final resourceDTO = ResourceDTO(); // ResourceDTO |
try { try {
final result = api_instance.resourceCreate(resourceDetailDTO); final result = api_instance.resourceCreate(resourceDTO);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ResourceApi->resourceCreate: $e\n'); print('Exception when calling ResourceApi->resourceCreate: $e\n');
@ -44,11 +44,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**resourceDetailDTO** | [**ResourceDetailDTO**](ResourceDetailDTO.md)| | **resourceDTO** | [**ResourceDTO**](ResourceDTO.md)| |
### Return type ### Return type
[**ResourceDetailDTO**](ResourceDetailDTO.md) [**ResourceDTO**](ResourceDTO.md)
### Authorization ### Authorization
@ -144,7 +144,7 @@ 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) [[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)
# **resourceGetDetail** # **resourceGetDetail**
> ResourceDetailDTO resourceGetDetail(id) > ResourceDTO resourceGetDetail(id)
@ -173,7 +173,7 @@ Name | Type | Description | Notes
### Return type ### Return type
[**ResourceDetailDTO**](ResourceDetailDTO.md) [**ResourceDTO**](ResourceDTO.md)
### Authorization ### Authorization
@ -230,7 +230,7 @@ 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) [[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)
# **resourceUpdate** # **resourceUpdate**
> ResourceDetailDTO resourceUpdate(resourceDetailDTO) > ResourceDTO resourceUpdate(resourceDTO)
@ -241,10 +241,10 @@ import 'package:managerapi/api.dart';
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final resourceDetailDTO = ResourceDetailDTO(); // ResourceDetailDTO | final resourceDTO = ResourceDTO(); // ResourceDTO |
try { try {
final result = api_instance.resourceUpdate(resourceDetailDTO); final result = api_instance.resourceUpdate(resourceDTO);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ResourceApi->resourceUpdate: $e\n'); print('Exception when calling ResourceApi->resourceUpdate: $e\n');
@ -255,11 +255,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**resourceDetailDTO** | [**ResourceDetailDTO**](ResourceDetailDTO.md)| | **resourceDTO** | [**ResourceDTO**](ResourceDTO.md)| |
### Return type ### Return type
[**ResourceDetailDTO**](ResourceDetailDTO.md) [**ResourceDTO**](ResourceDTO.md)
### Authorization ### Authorization

View File

@ -11,6 +11,7 @@ Name | Type | Description | Notes
**id** | **String** | | [optional] **id** | **String** | | [optional]
**type** | [**ResourceType**](ResourceType.md) | | [optional] **type** | [**ResourceType**](ResourceType.md) | | [optional]
**label** | **String** | | [optional] **label** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**data** | **String** | | [optional] **data** | **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) [[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 @@
# managerapi.model.ResponseDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isGood** | **bool** | | [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

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
``` ```
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -18,6 +18,7 @@ Method | HTTP request | Description
[**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | [**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
[**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | [**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
[**sectionGetMenuDTO**](SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO | [**sectionGetMenuDTO**](SectionApi.md#sectiongetmenudto) | **GET** /api/Section/MenuDTO |
[**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
[**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO | [**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
[**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO | [**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
[**sectionGetWebDTO**](SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO | [**sectionGetWebDTO**](SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
@ -401,6 +402,45 @@ 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) [[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()
### Example
```dart
import 'package:managerapi/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.sectionGetQuizzDTO();
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetQuizzDTO: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**QuizzDTO**](QuizzDTO.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)
# **sectionGetSliderDTO** # **sectionGetSliderDTO**
> SliderDTO sectionGetSliderDTO() > SliderDTO sectionGetSliderDTO()

View File

@ -5,7 +5,7 @@
import 'package:managerapi/api.dart'; import 'package:managerapi/api.dart';
``` ```
All URIs are relative to *http://192.168.31.96* All URIs are relative to *http://192.168.31.140*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------

View File

@ -38,17 +38,22 @@ part 'model/configuration_dto.dart';
part 'model/device_dto.dart'; part 'model/device_dto.dart';
part 'model/device_detail_dto.dart'; part 'model/device_detail_dto.dart';
part 'model/device_detail_dto_all_of.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/geo_point_dto.dart';
part 'model/image_dto.dart'; part 'model/image_dto.dart';
part 'model/image_geo_point.dart'; part 'model/image_geo_point.dart';
part 'model/level_dto.dart';
part 'model/login_dto.dart'; part 'model/login_dto.dart';
part 'model/map_dto.dart'; part 'model/map_dto.dart';
part 'model/map_type_app.dart'; part 'model/map_type_app.dart';
part 'model/menu_dto.dart'; part 'model/menu_dto.dart';
part 'model/player_message_dto.dart'; part 'model/player_message_dto.dart';
part 'model/question_dto.dart';
part 'model/quizz_dto.dart';
part 'model/resource_dto.dart'; part 'model/resource_dto.dart';
part 'model/resource_detail_dto.dart';
part 'model/resource_type.dart'; part 'model/resource_type.dart';
part 'model/response_dto.dart';
part 'model/section_dto.dart'; part 'model/section_dto.dart';
part 'model/section_type.dart'; part 'model/section_type.dart';
part 'model/slider_dto.dart'; part 'model/slider_dto.dart';

View File

@ -142,6 +142,70 @@ class ConfigurationApi {
return Future<String>.value(null); return Future<String>.value(null);
} }
/// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationExportWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}/export'
.replaceAll('{' + 'id' + '}', id.toString());
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ExportConfigurationDTO> configurationExport(String id) async {
final response = await configurationExportWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ExportConfigurationDTO') as ExportConfigurationDTO;
}
return Future<ExportConfigurationDTO>.value(null);
}
/// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response].
Future<Response> configurationGetWithHttpInfo() async { Future<Response> configurationGetWithHttpInfo() async {
final path = r'/api/Configuration'; final path = r'/api/Configuration';
@ -260,6 +324,69 @@ class ConfigurationApi {
return Future<ConfigurationDTO>.value(null); return Future<ConfigurationDTO>.value(null);
} }
/// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response].
/// Parameters:
///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<Response> configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async {
// Verify required params are set.
if (exportConfigurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO');
}
final path = r'/api/Configuration/import';
Object postBody = exportConfigurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// Parameters:
///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<String> configurationImport(ExportConfigurationDTO exportConfigurationDTO) async {
final response = await configurationImportWithHttpInfo(exportConfigurationDTO);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
}
/// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///

View File

@ -18,16 +18,16 @@ class ResourceApi {
/// Performs an HTTP 'POST /api/Resource' operation and returns the [Response]. /// Performs an HTTP 'POST /api/Resource' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDetailDTO] resourceDetailDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceCreateWithHttpInfo(ResourceDetailDTO resourceDetailDTO) async { Future<Response> resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async {
// Verify required params are set. // Verify required params are set.
if (resourceDetailDTO == null) { if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDetailDTO'); throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
} }
final path = r'/api/Resource'; final path = r'/api/Resource';
Object postBody = resourceDetailDTO; Object postBody = resourceDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
@ -63,9 +63,9 @@ class ResourceApi {
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDetailDTO] resourceDetailDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<ResourceDetailDTO> resourceCreate(ResourceDetailDTO resourceDetailDTO) async { Future<ResourceDTO> resourceCreate(ResourceDTO resourceDTO) async {
final response = await resourceCreateWithHttpInfo(resourceDetailDTO); final response = await resourceCreateWithHttpInfo(resourceDTO);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }
@ -73,9 +73,9 @@ class ResourceApi {
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDetailDTO') as ResourceDetailDTO; return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
} }
return Future<ResourceDetailDTO>.value(null); return Future<ResourceDTO>.value(null);
} }
/// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response]. /// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response].
@ -246,7 +246,7 @@ class ResourceApi {
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<ResourceDetailDTO> resourceGetDetail(String id) async { Future<ResourceDTO> resourceGetDetail(String id) async {
final response = await resourceGetDetailWithHttpInfo(id); final response = await resourceGetDetailWithHttpInfo(id);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -255,9 +255,9 @@ class ResourceApi {
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDetailDTO') as ResourceDetailDTO; return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
} }
return Future<ResourceDetailDTO>.value(null); return Future<ResourceDTO>.value(null);
} }
/// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response].
@ -327,16 +327,16 @@ class ResourceApi {
/// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDetailDTO] resourceDetailDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceUpdateWithHttpInfo(ResourceDetailDTO resourceDetailDTO) async { Future<Response> resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async {
// Verify required params are set. // Verify required params are set.
if (resourceDetailDTO == null) { if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDetailDTO'); throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
} }
final path = r'/api/Resource'; final path = r'/api/Resource';
Object postBody = resourceDetailDTO; Object postBody = resourceDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
@ -372,9 +372,9 @@ class ResourceApi {
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDetailDTO] resourceDetailDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<ResourceDetailDTO> resourceUpdate(ResourceDetailDTO resourceDetailDTO) async { Future<ResourceDTO> resourceUpdate(ResourceDTO resourceDTO) async {
final response = await resourceUpdateWithHttpInfo(resourceDetailDTO); final response = await resourceUpdateWithHttpInfo(resourceDTO);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, _decodeBodyBytes(response));
} }
@ -382,9 +382,9 @@ class ResourceApi {
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDetailDTO') as ResourceDetailDTO; return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
} }
return Future<ResourceDetailDTO>.value(null); return Future<ResourceDTO>.value(null);
} }
/// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response]. /// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response].

View File

@ -560,6 +560,58 @@ class SectionApi {
return Future<MenuDTO>.value(null); return Future<MenuDTO>.value(null);
} }
/// Performs an HTTP 'GET /api/Section/QuizzDTO' operation and returns the [Response].
Future<Response> sectionGetQuizzDTOWithHttpInfo() async {
final path = r'/api/Section/QuizzDTO';
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
Future<QuizzDTO> sectionGetQuizzDTO() async {
final response = await sectionGetQuizzDTOWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'QuizzDTO') as QuizzDTO;
}
return Future<QuizzDTO>.value(null);
}
/// Performs an HTTP 'GET /api/Section/SliderDTO' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Section/SliderDTO' operation and returns the [Response].
Future<Response> sectionGetSliderDTOWithHttpInfo() async { Future<Response> sectionGetSliderDTOWithHttpInfo() async {
final path = r'/api/Section/SliderDTO'; final path = r'/api/Section/SliderDTO';

View File

@ -10,7 +10,7 @@
part of openapi.api; part of openapi.api;
class ApiClient { class ApiClient {
ApiClient({this.basePath = 'http://192.168.31.96'}) { ApiClient({this.basePath = 'http://192.168.31.140'}) {
// Setup authentications (key: authentication name, value: authentication). // Setup authentications (key: authentication name, value: authentication).
_authentications[r'bearer'] = OAuth(); _authentications[r'bearer'] = OAuth();
} }
@ -164,12 +164,18 @@ class ApiClient {
return DeviceDetailDTO.fromJson(value); return DeviceDetailDTO.fromJson(value);
case 'DeviceDetailDTOAllOf': case 'DeviceDetailDTOAllOf':
return DeviceDetailDTOAllOf.fromJson(value); return DeviceDetailDTOAllOf.fromJson(value);
case 'ExportConfigurationDTO':
return ExportConfigurationDTO.fromJson(value);
case 'ExportConfigurationDTOAllOf':
return ExportConfigurationDTOAllOf.fromJson(value);
case 'GeoPointDTO': case 'GeoPointDTO':
return GeoPointDTO.fromJson(value); return GeoPointDTO.fromJson(value);
case 'ImageDTO': case 'ImageDTO':
return ImageDTO.fromJson(value); return ImageDTO.fromJson(value);
case 'ImageGeoPoint': case 'ImageGeoPoint':
return ImageGeoPoint.fromJson(value); return ImageGeoPoint.fromJson(value);
case 'LevelDTO':
return LevelDTO.fromJson(value);
case 'LoginDTO': case 'LoginDTO':
return LoginDTO.fromJson(value); return LoginDTO.fromJson(value);
case 'MapDTO': case 'MapDTO':
@ -181,13 +187,17 @@ class ApiClient {
return MenuDTO.fromJson(value); return MenuDTO.fromJson(value);
case 'PlayerMessageDTO': case 'PlayerMessageDTO':
return PlayerMessageDTO.fromJson(value); return PlayerMessageDTO.fromJson(value);
case 'QuestionDTO':
return QuestionDTO.fromJson(value);
case 'QuizzDTO':
return QuizzDTO.fromJson(value);
case 'ResourceDTO': case 'ResourceDTO':
return ResourceDTO.fromJson(value); return ResourceDTO.fromJson(value);
case 'ResourceDetailDTO':
return ResourceDetailDTO.fromJson(value);
case 'ResourceType': case 'ResourceType':
return ResourceTypeTypeTransformer().decode(value); return ResourceTypeTypeTransformer().decode(value);
case 'ResponseDTO':
return ResponseDTO.fromJson(value);
case 'SectionDTO': case 'SectionDTO':
return SectionDTO.fromJson(value); return SectionDTO.fromJson(value);
case 'SectionType': case 'SectionType':

View File

@ -0,0 +1,138 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ExportConfigurationDTO {
/// Returns a new [ExportConfigurationDTO] instance.
ExportConfigurationDTO({
this.id,
this.label,
this.primaryColor,
this.secondaryColor,
this.languages,
this.dateCreation,
this.sections,
this.resources,
});
String id;
String label;
String primaryColor;
String secondaryColor;
List<String> languages;
DateTime dateCreation;
List<SectionDTO> sections;
List<ResourceDTO> resources;
@override
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO &&
other.id == id &&
other.label == label &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
other.languages == languages &&
other.dateCreation == dateCreation &&
other.sections == sections &&
other.resources == resources;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(label == null ? 0 : label.hashCode) +
(primaryColor == null ? 0 : primaryColor.hashCode) +
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
(languages == null ? 0 : languages.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(sections == null ? 0 : sections.hashCode) +
(resources == null ? 0 : resources.hashCode);
@override
String toString() => 'ExportConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
if (label != null) {
json[r'label'] = label;
}
if (primaryColor != null) {
json[r'primaryColor'] = primaryColor;
}
if (secondaryColor != null) {
json[r'secondaryColor'] = secondaryColor;
}
if (languages != null) {
json[r'languages'] = languages;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
if (sections != null) {
json[r'sections'] = sections;
}
if (resources != null) {
json[r'resources'] = resources;
}
return json;
}
/// Returns a new [ExportConfigurationDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ExportConfigurationDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ExportConfigurationDTO(
id: json[r'id'],
label: json[r'label'],
primaryColor: json[r'primaryColor'],
secondaryColor: json[r'secondaryColor'],
languages: json[r'languages'] == null
? null
: (json[r'languages'] as List).cast<String>(),
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
);
static List<ExportConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ExportConfigurationDTO>[]
: json.map((v) => ExportConfigurationDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, ExportConfigurationDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, ExportConfigurationDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of ExportConfigurationDTO-objects as value to a dart map
static Map<String, List<ExportConfigurationDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ExportConfigurationDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ExportConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -0,0 +1,80 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ExportConfigurationDTOAllOf {
/// Returns a new [ExportConfigurationDTOAllOf] instance.
ExportConfigurationDTOAllOf({
this.sections,
this.resources,
});
List<SectionDTO> sections;
List<ResourceDTO> resources;
@override
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTOAllOf &&
other.sections == sections &&
other.resources == resources;
@override
int get hashCode =>
(sections == null ? 0 : sections.hashCode) +
(resources == null ? 0 : resources.hashCode);
@override
String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (sections != null) {
json[r'sections'] = sections;
}
if (resources != null) {
json[r'resources'] = resources;
}
return json;
}
/// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ExportConfigurationDTOAllOf fromJson(Map<String, dynamic> json) => json == null
? null
: ExportConfigurationDTOAllOf(
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
);
static List<ExportConfigurationDTOAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ExportConfigurationDTOAllOf>[]
: json.map((v) => ExportConfigurationDTOAllOf.fromJson(v)).toList(growable: true == growable);
static Map<String, ExportConfigurationDTOAllOf> mapFromJson(Map<String, dynamic> json) {
final map = <String, ExportConfigurationDTOAllOf>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ExportConfigurationDTOAllOf.fromJson(v));
}
return map;
}
// maps a json object with a list of ExportConfigurationDTOAllOf-objects as value to a dart map
static Map<String, List<ExportConfigurationDTOAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ExportConfigurationDTOAllOf>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ExportConfigurationDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -0,0 +1,89 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class LevelDTO {
/// Returns a new [LevelDTO] instance.
LevelDTO({
this.label,
this.resourceId,
this.source_,
});
List<TranslationDTO> label;
String resourceId;
String source_;
@override
bool operator ==(Object other) => identical(this, other) || other is LevelDTO &&
other.label == label &&
other.resourceId == resourceId &&
other.source_ == source_;
@override
int get hashCode =>
(label == null ? 0 : label.hashCode) +
(resourceId == null ? 0 : resourceId.hashCode) +
(source_ == null ? 0 : source_.hashCode);
@override
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (label != null) {
json[r'label'] = label;
}
if (resourceId != null) {
json[r'resourceId'] = resourceId;
}
if (source_ != null) {
json[r'source'] = source_;
}
return json;
}
/// Returns a new [LevelDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static LevelDTO fromJson(Map<String, dynamic> json) => json == null
? null
: LevelDTO(
label: TranslationDTO.listFromJson(json[r'label']),
resourceId: json[r'resourceId'],
source_: json[r'source'],
);
static List<LevelDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <LevelDTO>[]
: json.map((v) => LevelDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, LevelDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, LevelDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = LevelDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of LevelDTO-objects as value to a dart map
static Map<String, List<LevelDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<LevelDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = LevelDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -0,0 +1,107 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QuestionDTO {
/// Returns a new [QuestionDTO] instance.
QuestionDTO({
this.label,
this.responses,
this.resourceId,
this.source_,
this.order,
});
List<TranslationDTO> label;
List<ResponseDTO> responses;
String resourceId;
String source_;
int order;
@override
bool operator ==(Object other) => identical(this, other) || other is QuestionDTO &&
other.label == label &&
other.responses == responses &&
other.resourceId == resourceId &&
other.source_ == source_ &&
other.order == order;
@override
int get hashCode =>
(label == null ? 0 : label.hashCode) +
(responses == null ? 0 : responses.hashCode) +
(resourceId == null ? 0 : resourceId.hashCode) +
(source_ == null ? 0 : source_.hashCode) +
(order == null ? 0 : order.hashCode);
@override
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (label != null) {
json[r'label'] = label;
}
if (responses != null) {
json[r'responses'] = responses;
}
if (resourceId != null) {
json[r'resourceId'] = resourceId;
}
if (source_ != null) {
json[r'source'] = source_;
}
if (order != null) {
json[r'order'] = order;
}
return json;
}
/// Returns a new [QuestionDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static QuestionDTO fromJson(Map<String, dynamic> json) => json == null
? null
: QuestionDTO(
label: TranslationDTO.listFromJson(json[r'label']),
responses: ResponseDTO.listFromJson(json[r'responses']),
resourceId: json[r'resourceId'],
source_: json[r'source'],
order: json[r'order'],
);
static List<QuestionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <QuestionDTO>[]
: json.map((v) => QuestionDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, QuestionDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, QuestionDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = QuestionDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of QuestionDTO-objects as value to a dart map
static Map<String, List<QuestionDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<QuestionDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = QuestionDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -0,0 +1,107 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QuizzDTO {
/// Returns a new [QuizzDTO] instance.
QuizzDTO({
this.questions,
this.badLevel,
this.mediumLevel,
this.goodLevel,
this.greatLevel,
});
List<QuestionDTO> questions;
LevelDTO badLevel;
LevelDTO mediumLevel;
LevelDTO goodLevel;
LevelDTO greatLevel;
@override
bool operator ==(Object other) => identical(this, other) || other is QuizzDTO &&
other.questions == questions &&
other.badLevel == badLevel &&
other.mediumLevel == mediumLevel &&
other.goodLevel == goodLevel &&
other.greatLevel == greatLevel;
@override
int get hashCode =>
(questions == null ? 0 : questions.hashCode) +
(badLevel == null ? 0 : badLevel.hashCode) +
(mediumLevel == null ? 0 : mediumLevel.hashCode) +
(goodLevel == null ? 0 : goodLevel.hashCode) +
(greatLevel == null ? 0 : greatLevel.hashCode);
@override
String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (questions != null) {
json[r'questions'] = questions;
}
if (badLevel != null) {
json[r'bad_level'] = badLevel;
}
if (mediumLevel != null) {
json[r'medium_level'] = mediumLevel;
}
if (goodLevel != null) {
json[r'good_level'] = goodLevel;
}
if (greatLevel != null) {
json[r'great_level'] = greatLevel;
}
return json;
}
/// Returns a new [QuizzDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static QuizzDTO fromJson(Map<String, dynamic> json) => json == null
? null
: QuizzDTO(
questions: QuestionDTO.listFromJson(json[r'questions']),
badLevel: LevelDTO.fromJson(json[r'bad_level']),
mediumLevel: LevelDTO.fromJson(json[r'medium_level']),
goodLevel: LevelDTO.fromJson(json[r'good_level']),
greatLevel: LevelDTO.fromJson(json[r'great_level']),
);
static List<QuizzDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <QuizzDTO>[]
: json.map((v) => QuizzDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, QuizzDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, QuizzDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = QuizzDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of QuizzDTO-objects as value to a dart map
static Map<String, List<QuizzDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<QuizzDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = QuizzDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -15,6 +15,7 @@ class ResourceDTO {
this.id, this.id,
this.type, this.type,
this.label, this.label,
this.dateCreation,
this.data, this.data,
}); });
@ -24,6 +25,8 @@ class ResourceDTO {
String label; String label;
DateTime dateCreation;
String data; String data;
@override @override
@ -31,6 +34,7 @@ class ResourceDTO {
other.id == id && other.id == id &&
other.type == type && other.type == type &&
other.label == label && other.label == label &&
other.dateCreation == dateCreation &&
other.data == data; other.data == data;
@override @override
@ -38,10 +42,11 @@ class ResourceDTO {
(id == null ? 0 : id.hashCode) + (id == null ? 0 : id.hashCode) +
(type == null ? 0 : type.hashCode) + (type == null ? 0 : type.hashCode) +
(label == null ? 0 : label.hashCode) + (label == null ? 0 : label.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(data == null ? 0 : data.hashCode); (data == null ? 0 : data.hashCode);
@override @override
String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, data=$data]'; String toString() => 'ResourceDTO[id=$id, type=$type, label=$label, dateCreation=$dateCreation, data=$data]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final json = <String, dynamic>{};
@ -54,6 +59,9 @@ class ResourceDTO {
if (label != null) { if (label != null) {
json[r'label'] = label; json[r'label'] = label;
} }
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
}
if (data != null) { if (data != null) {
json[r'data'] = data; json[r'data'] = data;
} }
@ -68,6 +76,9 @@ class ResourceDTO {
id: json[r'id'], id: json[r'id'],
type: ResourceType.fromJson(json[r'type']), type: ResourceType.fromJson(json[r'type']),
label: json[r'label'], label: json[r'label'],
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
data: json[r'data'], data: json[r'data'],
); );

View File

@ -0,0 +1,89 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ResponseDTO {
/// Returns a new [ResponseDTO] instance.
ResponseDTO({
this.label,
this.isGood,
this.order,
});
List<TranslationDTO> label;
bool isGood;
int order;
@override
bool operator ==(Object other) => identical(this, other) || other is ResponseDTO &&
other.label == label &&
other.isGood == isGood &&
other.order == order;
@override
int get hashCode =>
(label == null ? 0 : label.hashCode) +
(isGood == null ? 0 : isGood.hashCode) +
(order == null ? 0 : order.hashCode);
@override
String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (label != null) {
json[r'label'] = label;
}
if (isGood != null) {
json[r'isGood'] = isGood;
}
if (order != null) {
json[r'order'] = order;
}
return json;
}
/// Returns a new [ResponseDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null.
static ResponseDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ResponseDTO(
label: TranslationDTO.listFromJson(json[r'label']),
isGood: json[r'isGood'],
order: json[r'order'],
);
static List<ResponseDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ResponseDTO>[]
: json.map((v) => ResponseDTO.fromJson(v)).toList(growable: true == growable);
static Map<String, ResponseDTO> mapFromJson(Map<String, dynamic> json) {
final map = <String, ResponseDTO>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ResponseDTO.fromJson(v));
}
return map;
}
// maps a json object with a list of ResponseDTO-objects as value to a dart map
static Map<String, List<ResponseDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ResponseDTO>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ResponseDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
}
return map;
}
}

View File

@ -27,6 +27,7 @@ class SectionType {
static const video = SectionType._(r'Video'); static const video = SectionType._(r'Video');
static const web = SectionType._(r'Web'); static const web = SectionType._(r'Web');
static const menu = SectionType._(r'Menu'); static const menu = SectionType._(r'Menu');
static const quizz = SectionType._(r'Quizz');
/// List of all possible values in this [enum][SectionType]. /// List of all possible values in this [enum][SectionType].
static const values = <SectionType>[ static const values = <SectionType>[
@ -35,6 +36,7 @@ class SectionType {
video, video,
web, web,
menu, menu,
quizz,
]; ];
static SectionType fromJson(dynamic value) => static SectionType fromJson(dynamic value) =>
@ -72,6 +74,7 @@ class SectionTypeTypeTransformer {
case r'Video': return SectionType.video; case r'Video': return SectionType.video;
case r'Web': return SectionType.web; case r'Web': return SectionType.web;
case r'Menu': return SectionType.menu; case r'Menu': return SectionType.menu;
case r'Quizz': return SectionType.quizz;
default: default:
if (allowNull == false) { if (allowNull == false) {
throw ArgumentError('Unknown enum value to decode: $data'); throw ArgumentError('Unknown enum value to decode: $data');

View File

@ -5,7 +5,7 @@ info:
description: API Manager Service description: API Manager Service
version: Version Alpha version: Version Alpha
servers: servers:
- url: http://192.168.31.96 - url: http://192.168.31.140
paths: paths:
/api/Configuration: /api/Configuration:
get: get:
@ -176,6 +176,92 @@ paths:
type: string type: string
security: security:
- bearer: [] - bearer: []
/api/Configuration/{id}/export:
get:
tags:
- Configuration
operationId: Configuration_Export
parameters:
- name: id
in: path
required: true
schema:
type: string
nullable: true
x-position: 1
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ExportConfigurationDTO'
'400':
description: ''
content:
application/json:
schema:
type: string
'404':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
/api/Configuration/import:
post:
tags:
- Configuration
operationId: Configuration_Import
requestBody:
x-name: exportConfiguration
content:
application/json:
schema:
$ref: '#/components/schemas/ExportConfigurationDTO'
required: true
x-position: 1
responses:
'202':
description: ''
content:
application/json:
schema:
type: string
'400':
description: ''
content:
application/json:
schema:
type: string
'404':
description: ''
content:
application/json:
schema:
type: string
'409':
description: ''
content:
application/json:
schema:
type: string
'500':
description: ''
content:
application/json:
schema:
type: string
security:
- bearer: []
/api/Device: /api/Device:
get: get:
tags: tags:
@ -423,7 +509,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ResourceDetailDTO' $ref: '#/components/schemas/ResourceDTO'
required: true required: true
x-position: 1 x-position: 1
responses: responses:
@ -432,7 +518,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ResourceDetailDTO' $ref: '#/components/schemas/ResourceDTO'
'400': '400':
description: '' description: ''
content: content:
@ -462,7 +548,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ResourceDetailDTO' $ref: '#/components/schemas/ResourceDTO'
required: true required: true
x-position: 1 x-position: 1
responses: responses:
@ -471,7 +557,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ResourceDetailDTO' $ref: '#/components/schemas/ResourceDTO'
'400': '400':
description: '' description: ''
content: content:
@ -511,7 +597,7 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ResourceDetailDTO' $ref: '#/components/schemas/ResourceDTO'
'404': '404':
description: '' description: ''
content: content:
@ -1032,6 +1118,20 @@ paths:
$ref: '#/components/schemas/PlayerMessageDTO' $ref: '#/components/schemas/PlayerMessageDTO'
security: security:
- bearer: [] - bearer: []
/api/Section/QuizzDTO:
get:
tags:
- Section
operationId: Section_GetQuizzDTO
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/QuizzDTO'
security:
- bearer: []
/api/User: /api/User:
get: get:
tags: tags:
@ -1305,103 +1405,22 @@ components:
dateCreation: dateCreation:
type: string type: string
format: date-time format: date-time
DeviceDTO: ExportConfigurationDTO:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
identifier:
type: string
nullable: true
name:
type: string
nullable: true
ipAddressWLAN:
type: string
nullable: true
ipAddressETH:
type: string
nullable: true
configurationId:
type: string
nullable: true
configuration:
type: string
nullable: true
connected:
type: boolean
dateCreation:
type: string
format: date-time
dateUpdate:
type: string
format: date-time
DeviceDetailDTO:
allOf: allOf:
- $ref: '#/components/schemas/DeviceDTO' - $ref: '#/components/schemas/ConfigurationDTO'
- type: object - type: object
additionalProperties: false additionalProperties: false
properties: properties:
connectionLevel: sections:
type: string type: array
nullable: true nullable: true
lastConnectionLevel: items:
type: string $ref: '#/components/schemas/SectionDTO'
format: date-time resources:
batteryLevel: type: array
type: string
nullable: true
lastBatteryLevel:
type: string
format: date-time
ResourceDTO:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
type:
$ref: '#/components/schemas/ResourceType'
label:
type: string
nullable: true
data:
type: string
nullable: true
ResourceType:
type: string
description: ''
x-enumNames:
- Image
- Video
- ImageUrl
- VideoUrl
enum:
- Image
- Video
- ImageUrl
- VideoUrl
ResourceDetailDTO:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
type:
$ref: '#/components/schemas/ResourceType'
label:
type: string
nullable: true
dateCreation:
type: string
format: date-time
data:
type: string
nullable: true nullable: true
items:
$ref: '#/components/schemas/ResourceDTO'
SectionDTO: SectionDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1466,12 +1485,96 @@ components:
- Video - Video
- Web - Web
- Menu - Menu
- Quizz
enum: enum:
- Map - Map
- Slider - Slider
- Video - Video
- Web - Web
- Menu - Menu
- Quizz
ResourceDTO:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
type:
$ref: '#/components/schemas/ResourceType'
label:
type: string
nullable: true
dateCreation:
type: string
format: date-time
data:
type: string
nullable: true
ResourceType:
type: string
description: ''
x-enumNames:
- Image
- Video
- ImageUrl
- VideoUrl
enum:
- Image
- Video
- ImageUrl
- VideoUrl
DeviceDTO:
type: object
additionalProperties: false
properties:
id:
type: string
nullable: true
identifier:
type: string
nullable: true
name:
type: string
nullable: true
ipAddressWLAN:
type: string
nullable: true
ipAddressETH:
type: string
nullable: true
configurationId:
type: string
nullable: true
configuration:
type: string
nullable: true
connected:
type: boolean
dateCreation:
type: string
format: date-time
dateUpdate:
type: string
format: date-time
DeviceDetailDTO:
allOf:
- $ref: '#/components/schemas/DeviceDTO'
- type: object
additionalProperties: false
properties:
connectionLevel:
type: string
nullable: true
lastConnectionLevel:
type: string
format: date-time
batteryLevel:
type: string
nullable: true
lastBatteryLevel:
type: string
format: date-time
MapDTO: MapDTO:
type: object type: object
additionalProperties: false additionalProperties: false
@ -1608,6 +1711,83 @@ components:
type: boolean type: boolean
isDeleted: isDeleted:
type: boolean type: boolean
QuizzDTO:
type: object
additionalProperties: false
properties:
questions:
type: array
nullable: true
items:
$ref: '#/components/schemas/QuestionDTO'
bad_level:
nullable: true
oneOf:
- $ref: '#/components/schemas/LevelDTO'
medium_level:
nullable: true
oneOf:
- $ref: '#/components/schemas/LevelDTO'
good_level:
nullable: true
oneOf:
- $ref: '#/components/schemas/LevelDTO'
great_level:
nullable: true
oneOf:
- $ref: '#/components/schemas/LevelDTO'
QuestionDTO:
type: object
additionalProperties: false
properties:
label:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
responses:
type: array
nullable: true
items:
$ref: '#/components/schemas/ResponseDTO'
resourceId:
type: string
nullable: true
source:
type: string
nullable: true
order:
type: integer
format: int32
ResponseDTO:
type: object
additionalProperties: false
properties:
label:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
isGood:
type: boolean
order:
type: integer
format: int32
LevelDTO:
type: object
additionalProperties: false
properties:
label:
type: array
nullable: true
items:
$ref: '#/components/schemas/TranslationDTO'
resourceId:
type: string
nullable: true
source:
type: string
nullable: true
User: User:
type: object type: object
additionalProperties: false additionalProperties: false

1708
manager_api/swagger.yaml.bak Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
// tests for ExportConfigurationDTOAllOf
void main() {
final instance = ExportConfigurationDTOAllOf();
group('test ExportConfigurationDTOAllOf', () {
// List<SectionDTO> sections (default value: const [])
test('to test the property `sections`', () async {
// TODO
});
// List<ResourceDTO> resources (default value: const [])
test('to test the property `resources`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,61 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
// tests for ExportConfigurationDTO
void main() {
final instance = ExportConfigurationDTO();
group('test ExportConfigurationDTO', () {
// String id
test('to test the property `id`', () async {
// TODO
});
// String label
test('to test the property `label`', () async {
// TODO
});
// String primaryColor
test('to test the property `primaryColor`', () async {
// TODO
});
// String secondaryColor
test('to test the property `secondaryColor`', () async {
// TODO
});
// List<String> languages (default value: const [])
test('to test the property `languages`', () async {
// TODO
});
// DateTime dateCreation
test('to test the property `dateCreation`', () async {
// TODO
});
// List<SectionDTO> sections (default value: const [])
test('to test the property `sections`', () async {
// TODO
});
// List<ResourceDTO> resources (default value: const [])
test('to test the property `resources`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,36 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
// tests for LevelDTO
void main() {
final instance = LevelDTO();
group('test LevelDTO', () {
// List<TranslationDTO> label (default value: const [])
test('to test the property `label`', () async {
// TODO
});
// String resourceId
test('to test the property `resourceId`', () async {
// TODO
});
// String source_
test('to test the property `source_`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,46 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
// tests for QuestionDTO
void main() {
final instance = QuestionDTO();
group('test QuestionDTO', () {
// List<TranslationDTO> label (default value: const [])
test('to test the property `label`', () async {
// TODO
});
// List<ResponseDTO> responses (default value: const [])
test('to test the property `responses`', () 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
});
});
}

View File

@ -0,0 +1,46 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
// tests for QuizzDTO
void main() {
final instance = QuizzDTO();
group('test QuizzDTO', () {
// List<QuestionDTO> questions (default value: const [])
test('to test the property `questions`', () async {
// TODO
});
// OneOfLevelDTO badLevel
test('to test the property `badLevel`', () async {
// TODO
});
// OneOfLevelDTO mediumLevel
test('to test the property `mediumLevel`', () async {
// TODO
});
// OneOfLevelDTO goodLevel
test('to test the property `goodLevel`', () async {
// TODO
});
// OneOfLevelDTO greatLevel
test('to test the property `greatLevel`', () async {
// TODO
});
});
}

View File

@ -0,0 +1,36 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: lines_longer_than_80_chars
import 'package:managerapi/api.dart';
import 'package:test/test.dart';
// tests for ResponseDTO
void main() {
final instance = ResponseDTO();
group('test ResponseDTO', () {
// List<TranslationDTO> label (default value: const [])
test('to test the property `label`', () async {
// TODO
});
// bool isGood
test('to test the property `isGood`', () async {
// TODO
});
// int order
test('to test the property `order`', () async {
// TODO
});
});
}

View File

@ -57,6 +57,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
confetti:
dependency: "direct main"
description:
name: confetti
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.0"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@ -77,14 +84,14 @@ packages:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.3" version: "1.0.4"
device_info: device_info:
dependency: "direct main" dependency: "direct main"
description: description:
name: device_info name: device_info
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.0.3"
device_info_platform_interface: device_info_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -138,7 +145,7 @@ packages:
name: flutter_plugin_android_lifecycle name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.2" version: "2.0.5"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -155,21 +162,21 @@ packages:
name: fluttertoast name: fluttertoast
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.0.8" version: "8.0.9"
google_maps_flutter: google_maps_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
name: google_maps_flutter name: google_maps_flutter
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.6" version: "2.1.3"
google_maps_flutter_platform_interface: google_maps_flutter_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: google_maps_flutter_platform_interface name: google_maps_flutter_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1" version: "2.1.5"
http: http:
dependency: "direct main" dependency: "direct main"
description: description:
@ -274,7 +281,7 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.1.2"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
@ -300,14 +307,14 @@ packages:
name: sqflite name: sqflite
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0+4" version: "2.0.2"
sqflite_common: sqflite_common:
dependency: transitive dependency: transitive
description: description:
name: sqflite_common name: sqflite_common
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.2.1"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -384,7 +391,28 @@ packages:
name: webview_flutter name: webview_flutter
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.12" version: "2.8.0"
webview_flutter_android:
dependency: transitive
description:
name: webview_flutter_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.3"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.dartlang.org"
source: hosted
version: "2.7.1"
youtube_player_flutter: youtube_player_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
@ -393,5 +421,5 @@ packages:
source: hosted source: hosted
version: "7.0.0+7" version: "7.0.0+7"
sdks: sdks:
dart: ">=2.14.0 <3.0.0" dart: ">=2.16.0 <3.0.0"
flutter: ">=2.0.0" flutter: ">=2.5.0"

View File

@ -37,6 +37,7 @@ dependencies:
youtube_player_flutter: ^7.0.0+7 youtube_player_flutter: ^7.0.0+7
mqtt_client: ^8.1.0 mqtt_client: ^8.1.0
photo_view: ^0.13.0 photo_view: ^0.13.0
confetti: ^0.6.0
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons. # Use with the CupertinoIcons class for iOS style icons.